Ubuntu 在Linux上安装Cordova

Ubuntu 在Linux上安装Cordova,ubuntu,cordova,sencha-touch-2,command-line-interface,xubuntu,Ubuntu,Cordova,Sencha Touch 2,Command Line Interface,Xubuntu,有人知道如何在Ubuntu/xUbuntu上安装Cordova吗 我试图按照链接和其他来源的指示执行,但没有成功 我收到以下长错误消息: root@li141-82:/var/www/mysite# npm install cordova npm http GET https://registry.npmjs.org/cordova npm ERR! Error: failed to fetch from registry: cordova npm ERR! at /usr/share

有人知道如何在Ubuntu/xUbuntu上安装Cordova吗

我试图按照链接和其他来源的指示执行,但没有成功

我收到以下长错误消息:

root@li141-82:/var/www/mysite# npm install cordova
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.g (events.js:156:14)
npm ERR!     at ClientRequest.emit (events.js:67:17)
npm ERR!     at HTTPParser.parserOnIncomingClient [as onIncoming] (http.js:1256:7)
npm ERR! You may report this log at:
npm ERR!     <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR!     reportbug --attach /var/www/mysite/npm-debug.log npm
npm ERR! 
npm ERR! System Linux 3.11.6-x86_64-linode35
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "cordova"
npm ERR! cwd /var/www/mysite
npm ERR! node -v v0.6.19
npm ERR! npm -v 1.1.4
npm ERR! message failed to fetch from registry: cordova
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /var/www/mysite/npm-debug.log
npm not ok
root@li141-82:/var/www/mysite#npm安装cordova
npm http GEThttps://registry.npmjs.org/cordova
npm错误!错误:无法从注册表获取:cordova
npm错误!在/usr/share/npm/lib/utils/npm registry client/get.js:139:12
npm错误!在cb(/usr/share/npm/lib/utils/npm registry client/request.js:31:9)
npm错误!应请求。\回调(/usr/share/npm/lib/utils/npm registry client/Request.js:136:18)
npm错误!at Request.callback(/usr/lib/nodejs/Request/main.js:119:22)
npm错误!应要求。(/usr/lib/nodejs/request/main.js:212:58)
npm错误!at Request.emit(events.js:88:20)
npm错误!在ClientRequest。(/usr/lib/nodejs/request/main.js:412:12)
npm错误!在ClientRequest.g(events.js:156:14)
npm错误!在ClientRequest.emit(events.js:67:17)
npm错误!在HTTPParser.parserOnIncomingClient[作为onIncoming](http.js:1256:7)
npm错误!您可以在以下位置报告此日志:
npm错误!
npm错误!或使用
npm错误!reportbug——attach/var/www/mysite/npm-debug.log npm
npm错误!
npm错误!系统Linux 3.11.6-x86_64-linode35
npm错误!命令“/usr/bin/nodejs”“/usr/bin/npm”“安装”“cordova”
npm错误!cwd/var/www/mysite
npm错误!节点-v v0.6.19
npm错误!npm-V1.1.4
npm错误!无法从注册表获取消息:cordova
npm错误!
npm错误!其他日志记录详细信息可在以下位置找到:
npm错误/var/www/mysite/npm-debug.log
npm不好

我想您正在寻找一种基于Cordova的工具。要安装PhoneGap,您需要安装node,然后
sudo npm install-g PhoneGap

如果您只需要Cordova,则可以下载zip文件。

查看:


您需要设置NPM注册表

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

按照以下命令在ubuntu上安装cordova:
1美元sudo-apt-get-install-npm
2美元sudo npm安装节点
3美元sudo npm安装-g cordova
4美元科尔多瓦 如果未显示任何命令,则使用备用命令:
1.$sudo apt获取删除节点
2美元sudo apt get install python软件属性python g++make
3美元sudo添加apt存储库ppa:chris lea/node.js
4美元更新源
5美元sudo-apt-get-install-nodejs
6美元sudo npm安装-g cordova

7美元ln-s/usr/bin/nodejs/usr/bin/node

谢谢。根据本文安装node.js后工作-此答案已过时,请参阅下面@steinar的答案当我设置此注册表时,四行工作,然后没有显示任何内容就停止。npm http GET npm http 304 npm http GET npm http 200。在这之后,什么也看不出来。我试了三次,结果还是一样。
npm config set registry http://registry.npmjs.org/