Node.js 使用$sudo npm安装时出错-g mean cli

Node.js 使用$sudo npm安装时出错-g mean cli,node.js,ubuntu,meanjs,Node.js,Ubuntu,Meanjs,我是新手,我在ubuntu上安装了MEAN.JS Stack, 但是当我使用 $sudo npm安装-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.

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

$sudo npm安装-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
gyp ERR!构建错误
哎呀!堆栈错误:`make`失败,退出代码:2
哎呀!堆栈位于ChildProcess.onExit(/usr/local/lib/node_modules/npm/node_modules/node gyp/lib/build.js:267:23)
哎呀!ChildProcess.emit上的堆栈(events.js:98:17)
哎呀!在Process.ChildProcess.\u handle.onexit(child\u Process.js:810:12)处堆栈
哎呀!Linux系统3.13.0-80-generic
哎呀!命令“node”“/usr/local/lib/node_modules/npm/node_modules/node gyp/bin/node gyp.js”“rebuild”
哎呀!cwd/usr/local/lib/node_modules/mean cli/node_modules/mongoose/node_modules/mongodb/node_modules/mongodb core/node_modules/kerberos
哎呀!节点-v v0.10.33
哎呀!节点gyp-v1.0.1
哎呀!不好
npm错误!错误:找不到404
npm错误!在WriteStream。(/usr/local/lib/node_modules/npm/lib/utils/fetch.js:58:12)
npm错误!在WriteStream.emit(events.js:117:20)
npm错误!在评估机:1609:14
npm错误!at/usr/local/lib/node_modules/npm/node_modules/generate fs/generate fs.js:102:5
npm错误!在Object.oncomplete(评估机器:107:15)
npm错误!如果您需要帮助,可以报告此*整个*日志,
npm错误!包括npm和节点版本,位于:
npm错误!
npm错误!Linux系统3.13.0-80-generic
npm错误!命令“/usr/local/bin/node”“/usr/local/bin/npm”“install”“-g”“表示cli”
npm错误!cwd/家庭/特拉维斯
npm错误!节点-v v0.10.33
npm错误!npm-V1.4.28
npm错误!不正常代码0

我怎样才能解决这个问题?谢谢。

请确保您的internet连接已建立。此错误是由于网络连接失败造成的。

问题是nodejs和npm的版本,我确认了这一点,只需更新node.js和npm。

您升级了ubantu吗?什么是当前版本你的意思是ubuntu,我用Ubuntu14.04 LTSTry升级你的ubantu?谢谢,我已经解决了。有什么问题吗?