科尔多瓦无法安装

时间:2014-10-02 12:08:43

标签: cordova npm

我发布了一个问题(人们没有正当理由关闭了这些问题 - https://stackoverflow.com/questions/26149969/update-cordova-platform-3-5-1-not-working

他们引用的解决方案因为我收到此错误而无法正常工作:

npm http GET https://registry.npmjs.org/cordova

npm ERR! Error: failed to fetch from registry: cordova
npm ERR!     at /usr/share/npm/lib/utils/npm-registry-client/get.js:139:12
npm ERR!     at cb (/usr/share/npm/lib/utils/npm-registry-client/request.js:31:9)
npm ERR!     at Request._callback (/usr/share/npm/lib/utils/npm-registry-client/request.js:136:18)
npm ERR!     at Request.callback (/usr/lib/nodejs/request/main.js:119:22)
npm ERR!     at Request.<anonymous> (/usr/lib/nodejs/request/main.js:212:58)
npm ERR!     at Request.emit (events.js:88:20)
npm ERR!     at ClientRequest.<anonymous> (/usr/lib/nodejs/request/main.js:412:12)
npm ERR!     at ClientRequest.emit (events.js:67:17)
npm ERR!     at HTTPParser.onIncoming (http.js:1261:11)
npm ERR!     at HTTPParser.onHeadersComplete (http.js:102:31)

任何人都知道如何解决这个问题?

3 个答案:

答案 0 :(得分:1)

首先尝试使用以下方式设置npm注册表:

npm config set registry http://registry.npmjs.org/

答案 1 :(得分:0)

我最终使用这些网站的webview使用本机代码:

http://developer.android.com/guide/webapps/webview.html

http://www.mkyong.com/android/android-webview-example/

更新Cordova从未用过。

答案 2 :(得分:0)

尝试更新npm:

$ sudo npm install npm -g

然后更新cordova

$ sudo npm install -g cordova