使用 $ sudo npm install -g mean-cli 时出错

Error when using $ sudo npm install -g mean-cli

我是新手,我在 ubuntu 上安装了 MEAN.JS Stack, 但是当我使用

$ sudo npm install -g mean-cli

我明白了

gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:810:12)
gyp ERR! System Linux 3.13.0-80-generic
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/mean-cli/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb-core/node_modules/kerberos
gyp ERR! node -v v0.10.33
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok 
npm ERR! Error: 404 Not Found
npm ERR!     at WriteStream.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/fetch.js:58:12)
npm ERR!     at WriteStream.emit (events.js:117:20)
npm ERR!     at evalmachine.<anonymous>:1609:14
npm ERR!     at /usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:102:5
npm ERR!     at Object.oncomplete (evalmachine.<anonymous>:107:15)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR!     <http://github.com/npm/npm/issues>

npm ERR! System Linux 3.13.0-80-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "mean-cli"
npm ERR! cwd /home/travis
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! not ok code 0

我该如何解决这个问题?谢谢

请确保您的互联网连接正常 established.This 由于网络连接失败

出现错误

问题是nodejs和npm的版本问题,我已经解决了,只需更新node.js和npm即可。