cordova-cli: Failed to fetch platform
Cordova version: 7.0.1 and 7.1.0
Last time build app was on 09.10.18.
But now when running npx cordova platform add ios@4.5.4
, I’m getting following error:
Error: Failed to fetch platform cordova-ios@4.5.4
Probably this is either a connection problem, or platform spec is incorrect.
Check your connection and platform name/version/URL.
Error: npm: Command failed with exit code 1 Error output:
npm WARN package.json NAME.app@1.0.0 No repository ##field.
npm WARN package.json NAME.app@1.0.0 No README data
npm ERR! Darwin 18.0.0
npm ERR! argv "/usr/local/bin/node" "/PATH/node_modules/.bin/npm" "install" "cordova-ios@4.5.4" "--save"
npm ERR! node v8.12.0
npm ERR! npm v2.15.12
npm ERR! code EPEERINVALID
npm ERR! peerinvalid The package acorn@5.7.3 does not satisfy its siblings' peerDependencies requirements!
Found that ticket of acorn package.
Any work around?
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 22 (9 by maintainers)
Commits related to this issue
- Unpin cordova CLI version dependency - see https://github.com/apache/cordova-cli/issues/357#issuecomment-440677778 — committed to dpa99c/cordova-check-plugins by dpa99c 6 years ago
@genox I’ve unpinned the cordova version in dependencies of
cordova-check-plugins
(my package, my bad) and published a patch version to npm ascordova-check-plugins@4.0.4
- should resolve your issue, though global installation is recommended as it’s a CLI tool (as iscordova
)workaround: run
npm install acorn
in the Cordova project directory. that should installacorn@6
and that fixes the error for me (usingcordova@8.1.2
)My team project appears to have acquired a direct dependency on
cordova-lib@7.1.0
- removing it resolves the issue.├─┬ cordova-lib@7.1.0
npm ls npm
output:I removed
cordova-check-plugins
from the project and after another reset, things seem to install fine now. Thanks for your help!