Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'cordova plugin add' with searchpath doesn't work #455

Open
3 tasks done
feiandytan opened this issue Sep 2, 2019 · 0 comments
Open
3 tasks done

'cordova plugin add' with searchpath doesn't work #455

feiandytan opened this issue Sep 2, 2019 · 0 comments

Comments

@feiandytan
Copy link

feiandytan commented Sep 2, 2019

Bug Report

Problem

cordova plugin add with searchpath doesn't work. CLI will prompt error code 404 not found.

Command or Code

Suppose I have a locally built cordova plugin [email protected] in folder C:\SAP\KapselSDK4.2.7snapshot\plugins.

Run the command cordova plugin add kapsel-plugin-corelibs --searchpath C:\SAP\KapselSDK4.2.7snapshot\plugins --verbose
then following error occurs:

No scripts found for hook "before_plugin_add".
No version specified for kapsel-plugin-corelibs, retrieving version from config.xml
No version for kapsel-plugin-corelibs saved in config.xml or package.json
Not checking npm info for kapsel-plugin-corelibs because searchpath or noregistry flag was given
Calling plugman.fetch on plugin "kapsel-plugin-corelibs"
fetch: Installing kapsel-plugin-corelibs to C:\Users\i062893\cordova-workspace\app
Running command: npm install kapsel-plugin-corelibs --production --save
Command finished with error code 1: npm install,kapsel-plugin-corelibs,--production,--save
Failed to fetch plugin kapsel-plugin-corelibs via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: npm: Command failed with exit code 1 Error output:
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/kapsel-plugin-corelibs - Not found
npm ERR! 404
npm ERR! 404  'kapsel-plugin-corelibs@latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\i062893\AppData\Roaming\npm-cache\_logs\2019-09-02T06_17_19_544Z-debug.log
CordovaError: Failed to fetch plugin kapsel-plugin-corelibs via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: npm: Command failed with exit code 1 Error output:
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/kapsel-plugin-corelibs - Not found
npm ERR! 404
npm ERR! 404  'kapsel-plugin-corelibs@latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\i062893\AppData\Roaming\npm-cache\_logs\2019-09-02T06_17_19_544Z-debug.log
    at C:\Users\i062893\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\fetch.js:146:43
    at process._tickCallback (internal/process/next_tick.js:68:7)

Please note that the workaround is to append version in the plugin name: so if I run command cordova plugin add [email protected] --searchpath C:\SAP\KapselSDK4.2.7snapshot\plugins --verbose
The plugin can be added successfully:

No scripts found for hook "before_plugin_add".
Calling plugman.fetch on plugin "[email protected]"
Found [email protected] at C:\SAP\KapselSDK4.2.7snapshot\plugins\corelibs
Copying plugin "C:\SAP\KapselSDK4.2.7snapshot\plugins\corelibs" => "C:\Users\i062893\cordova-workspace\app\plugins\kapsel-plugin-corelibs"
Adding kapsel-plugin-corelibs to package.json
No scripts found for hook "after_plugin_add".

Environment, Platform, Device

Windows 10.

Version information

Cordova CLI version: 9.0.0 ([email protected])

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant