问题
i am learning cordova. i am on ubuntu 14.04 LTS and cordova version installed on my machine is 4.3.1 . i am trying to create simple project using command
cordova create MyApp
but i am getting below error
Creating a new cordova project with name "HelloCordova" and id "io.cordova.hellocordova" at location "/home/sanjay/Desktop/MyApp"
Downloading cordova library for www...
Error: HTTP error 404 retrieving version 3.6.3 of cordova for www
at Request._callback (/usr/share/cordova-cli/node_modules/cordova-lib/src/cordova/lazy_load.js:251:30)
at Request.self.callback (/usr/share/cordova-cli/node_modules/cordova-lib/node_modules/request/request.js:372:22)
at emitTwo (events.js:126:13)
at Request.emit (events.js:214:7)
at Request.<anonymous> (/usr/share/cordova-cli/node_modules/cordova-lib/node_modules/request/request.js:1310:14)
at emitOne (events.js:121:20)
at Request.emit (events.js:211:7)
at IncomingMessage.<anonymous> (/usr/share/cordova-cli/node_modules/cordova-lib/node_modules/request/request.js:1258:12)
at emitNone (events.js:111:20)
at IncomingMessage.emit (events.js:208:7)
What could be the reason for this errror ? how to solve this issue.
回答1:
in order to prevent this error, you need to update Cordova to the latest available version. you can force him to update using this command in Linux:
npm install -g cordova@7.0.0
modify the 7.0.0 by the latest version
回答2:
I had the same problem with ubuntu 16.04 and cordova 4.3.1. I solved it with sudo:
sudo cordova create MyApp
来源:https://stackoverflow.com/questions/53466570/cordova-error-http-error-404-retrieving-version-3-6-3-of-cordova-for-www