pramod@pramod-Inspiron-5520:~$ sudo npm install -g phonegap
npm ERR! Error: Invalid protocol
npm ERR! at Request.init (/usr/lib/nodejs/request/index.js:361:51)
npm ERR! at new Request (/usr/lib/nodejs/request/index.js:124:8)
npm ERR! at request (/usr/lib/nodejs/request/index.js:1279:11)
npm ERR! at RegClient.makeRequest (/usr/share/npm/node_modules/npm-registry-client/lib/request.js:208:13)
npm ERR! at RegClient.<anonymous> (/usr/share/npm/node_modules/npm-registry-client/lib/request.js:117:17)
npm ERR! at null._onTimeout (/usr/lib/nodejs/retry/lib/retry_operation.js:32:10)
npm ERR! at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <[email protected]>
npm ERR! System Linux 3.13.0-45-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "phonegap"
npm ERR! cwd /home/pramod
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/pramod/npm-debug.log
npm ERR! not ok code 0
答案1
npm ERR!错误:协议无效
当代理未设置为完整绝对 URL 时将显示。
你需要做一个...
npm config set proxy http://username:password@host:port
npm config set https-proxy http://username:password@host:port
其中用户名、密码、主机和端口需要更改以适合您的情况。