gpt4 book ai didi

node.js - 如何在 Ubuntu 12.04 中安装 cordova?

转载 作者:太空宇宙 更新时间:2023-11-03 22:15:54 26 4
gpt4 key购买 nike

我尝试在 Ubuntu 12.04 中运行 sudo npm install -g cordova。我收到此错误:

info it worked if it ends with ok
verbose cli [ 'node', '/usr/bin/npm', 'install', '-g', 'cordova' ]
info using npm@1.1.4
info using node@v0.6.12
verbose config file /home/desarrollador/.npmrc
verbose config file /usr/etc/npmrc
verbose config file /usr/share/npm/npmrc
silly exec /usr/bin/node "/usr/share/npm/bin/npm-get-uid-gid.js" "nobody" 1001
silly spawning [ '/usr/bin/node',
silly spawning [ '/usr/share/npm/bin/npm-get-uid-gid.js', 'nobody', 1001 ],
silly spawning null ]
silly output from getuid/gid {"uid":65534,"gid":1001}
silly output from getuid/gid
verbose cache add [ 'cordova', null ]
silly cache add: name, spec, args [ undefined, 'cordova', [ 'cordova', null ] ]
verbose parsed url { pathname: 'cordova', path: 'cordova', href: 'cordova' }
verbose addNamed [ 'cordova', '' ]
verbose addNamed [ null, '' ]
silly name, range, hasData [ 'cordova', '', false ]
verbose raw, before any munging cordova
verbose url resolving [ 'https://registry.npmjs.org/', './cordova' ]
verbose url resolved https://registry.npmjs.org/cordova
http GET https://registry.npmjs.org/cordova
ERR! Error: failed to fetch from registry: cordova
ERR! at /usr/share/npm/lib/utils/npm-registry-client/get.js:139:12
ERR! at cb (/usr/share/npm/lib/utils/npm-registry-client/request.js:31:9)
ERR! at Request._callback (/usr/share/npm/lib/utils/npm-registry-client/request.js:136:18)
ERR! at Request.callback (/usr/lib/nodejs/request/main.js:119:22)
ERR! at Request. (/usr/lib/nodejs/request/main.js:212:58)
ERR! at Request.emit (events.js:88:20)
ERR! at ClientRequest. (/usr/lib/nodejs/request/main.js:412:12)
ERR! at ClientRequest.emit (events.js:67:17)
ERR! at HTTPParser.onIncoming (http.js:1261:11)
ERR! at HTTPParser.onHeadersComplete (http.js:102:31)
ERR! You may report this log at:
ERR! http://bugs.debian.org/npm
ERR! or use
ERR! reportbug --attach /home/desarrollador/npm-debug.log npm
ERR!
ERR! System Linux 3.5.0-59-generic
ERR! command "node" "/usr/bin/npm" "install" "-g" "cordova"
ERR! cwd /home/desarrollador
ERR! node -v v0.6.12
ERR! npm -v 1.1.4
ERR! message failed to fetch from registry: cordova

我做错了什么?

最佳答案

按照以下命令在 ubuntu 上安装 cordova :
1. $ sudo apt-get install npm
2. $ sudo npm 安装 Node
3. $ sudo npm install -g Cordova
4. $ Cordova

如果显示未找到命令,则使用替代:
1.$ sudo apt-get 删除 Node
2. $ sudo apt-get install python-software-properties python g++ make
3. $ sudo add-apt-repository ppa:chris-lea/node.js
4. $ sudo apt-get 更新
5. $ sudo apt-get 安装nodejs
6. $ sudo npm install -g Cordova
7. $ ln -s/usr/bin/nodejs/usr/bin/node

关于node.js - 如何在 Ubuntu 12.04 中安装 cordova?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29086250/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com