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

Plugin installation fails with TypeError #79

Closed
hayuki opened this issue Oct 28, 2016 · 3 comments
Closed

Plugin installation fails with TypeError #79

hayuki opened this issue Oct 28, 2016 · 3 comments
Labels

Comments

@hayuki
Copy link

hayuki commented Oct 28, 2016

Hello,

I have looked through the closed issues to see if anyone had the same problem as I am currently experiencing, but I did not see anything, so I decided to open a separate issue for this.

When I run $cordova plugin add cordova-custom-config --save it starts downloading npm dependencies but fails with the following output:

Failed to install 'cordova-custom-config':undefined
Error: Error installing npm dependencies: Error: Command failed: npm install cordova-custom-config
C:\DEV\Momentum App Ionic2\momentum-client-app-v2\node_modules\.staging\cordova-custom-config-a5d62a5e\node_modules\semver\semver.js:678
    throw new TypeError('Invalid comparator: ' + comp);
    ^

TypeError: Invalid comparator: '
    at Comparator.parse (C:\DEV\Momentum App Ionic2\momentum-client-app-v2\node_modules\.staging\cordova-custom-config-a5d62a5e\node_modules\semver\semver.js:678:11)
    at new Comparator (C:\DEV\Momentum App Ionic2\momentum-client-app-v2\node_modules\.staging\cordova-custom-config-a5d62a5e\node_modules\semver\semver.js:662:8)
    at C:\DEV\Momentum App Ionic2\momentum-client-app-v2\node_modules\.staging\cordova-custom-config-a5d62a5e\node_modules\semver\semver.js:780:12
    at Array.map (native)
    at Range.parseRange (C:\DEV\Momentum App Ionic2\momentum-client-app-v2\node_modules\.staging\cordova-custom-config-a5d62a5e\node_modules\semver\semver.js:779:13)
    at Range.<anonymous> (C:\DEV\Momentum App Ionic2\momentum-client-app-v2\node_modules\.staging\cordova-custom-config-a5d62a5e\node_modules\semver\semver.js:721:17)
    at Array.map (native)
    at new Range (C:\DEV\Momentum App Ionic2\momentum-client-app-v2\node_modules\.staging\cordova-custom-config-a5d62a5e\node_modules\semver\semver.js:720:40)
    at C:\DEV\Momentum App Ionic2\momentum-client-app-v2\node_modules\.staging\cordova-custom-config-a5d62a5e\node_modules\check-node-version\index.js:50:20
    at end (C:\DEV\Momentum App Ionic2\momentum-client-app-v2\node_modules\.staging\cordova-custom-config-a5d62a5e\node_modules\run-parallel\index.js:16:15)
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.14
npm WARN @angularclass/hmr@1.2.1 requires a peer of webpack@* but none was installed.
npm ERR! Windows_NT 10.0.10240
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "cordova-custom-config"
npm ERR! node v6.7.0
npm ERR! npm  v3.10.3
npm ERR! code ELIFECYCLE

npm ERR! cordova-custom-config@3.0.12 preinstall: `npm install check-node-version && check-node-version --npm '>=3'`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the cordova-custom-config@3.0.12 preinstall script 'npm install check-node-version && check-node-version --npm '>=3''.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the cordova-custom-config package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm install check-node-version && check-node-version --npm '>=3'
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs cordova-custom-config
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls cordova-custom-config
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\DEV\Momentum App Ionic2\momentum-client-app-v2\npm-debug.log

My current runtime environment info is as follows:

NPM: 3.10.3
Cordova CLI: 6.2.0
Gulp version: CLI version 3.9.1
Gulp local:
Ionic Framework Version: 2.0.0-rc.1
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
OS:
Node Version: v6.7.0

I would appreciate any help on this...

@hayuki hayuki changed the title Plugin installation fails with "semver" error Plugin installation fails with TypeError Oct 28, 2016
@dpa99c
Copy link
Owner

dpa99c commented Oct 28, 2016

Seems the use of single quotes in the preinstall version check is causing the error in Windows env but not *nix/OSX/cygwin:

npm install check-node-version && check-node-version --npm '>=3'

Changing to double quotes seems to make it happy:

npm install check-node-version && check-node-version --npm ">=3"

Will release a patch version with this fix.

@dpa99c dpa99c added the bug label Oct 28, 2016
@dpa99c dpa99c closed this as completed in 50ba428 Oct 28, 2016
@dpa99c
Copy link
Owner

dpa99c commented Oct 28, 2016

published to npm as cordova-custom-config@3.0.13

@hayuki
Copy link
Author

hayuki commented Oct 28, 2016

Perfect! @dpa99c, thank you for such a quick response and fix :)

dpa99c added a commit that referenced this issue Nov 23, 2016
Resolves #76 while hopefully not breaking #79 and #80 again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants