我试图按照指南http://madebyknight.com/installing-phonegapcordova-windows-linux/
在ubuntu 15.0上运行的机器上安装cordova / phonegap我也尝试了以下两个指南,但遇到了同样的问题
http://dasunhegoda.com/installrun-phonegap-ubuntu/797/
http://www.levibotelho.com/development/the-complete-guide-to-running-phonegap-on-ubuntu
在运行此命令时,我得到的是以下结果
命令:
npm install –g phonegap@3.4
npm install –g cordova@3.4
结果:
npm WARN package.json node@0.0.0 No description
npm WARN package.json node@0.0.0 No repository field.
npm WARN package.json node@0.0.0 No README data
npm ERR! 404 Not Found
npm ERR! 404
npm ERR! 404 '–g' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.
npm ERR! System Linux 3.19.0-15-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "–g" "phonegap@3.4"
npm ERR! cwd /home/user
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.4.21
npm ERR! code E404
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/user/npm-debug.log
npm ERR! not ok code 0
npm WARN package.json node@0.0.0 No description
npm WARN package.json node@0.0.0 No repository field.
npm WARN package.json node@0.0.0 No README data
npm ERR! 404 Not Found
npm ERR! 404
npm ERR! 404 '–g' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.
npm ERR! System Linux 3.19.0-15-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "–g" "cordova@3.4"
npm ERR! cwd /home/user
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.4.21
npm ERR! code E404
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/user/npm-debug.log
npm ERR! not ok code 0
感谢任何帮助。
答案 0 :(得分:0)
您的nodejs安装无法正常运行。尝试重新安装nodejs,然后执行此命令。如果您查看错误,则无法识别-g
全局开关,指示您的nodejs和npm的问题
答案 1 :(得分:0)
看起来你正在使用如下所述的错误的高分号:
https://github.com/npm/npm/issues/1859,您应该在终端中手动输入命令(特别是-g)或尝试sudo npm install -g cordova@3.4
它可能有效
如果您仍然遇到相同的错误,此网址可能会对您有所帮助:http://www.himpfen.com/install-apache-cordova-ubuntu/
首先检查nodejs -v
是否正确安装NPM,如果有效,请尝试安装尝试安装cordova的后续步骤