【发布时间】:2016-02-01 12:42:07
【问题描述】:
在使用 Windows 很长时间后,我刚给自己买了一本 mac book。
我正在尝试从事我一直在从事的 MeanJS 项目。
在项目上执行npm install 会引发错误
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/Aayush/Work/lishn/repo/lishn-alpha/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/v8-debug/build/debug/v0.4.6/node-v46-darwin-x64/debug.node --module_name=debug --module_path=/Users/Aayush/Work/lishn/repo/lishn-alpha/node_modules/grunt-node-inspector/node_modules/node-inspector/node_modules/v8-debug/build/debug/v0.4.6/node-v46-darwin-x64' (1)
npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v4.1.1
npm ERR! npm v2.14.4
npm ERR! code ELIFECYCLE
>
> npm ERR! v8-debug@0.4.6 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the v8-debug@0.4.6 install script 'node-pre-gyp install --fallback-to-build'.
npm ERR! This is most likely a problem with the v8-debug package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build
npm ERR! You can get their info via:
npm ERR! npm owner ls v8-debug
npm ERR! There is likely additional logging output above.
我尝试清除缓存。
我尝试使用sudo 和--unsafe-perm 安装node-pre-gyp
我也尝试重新安装一个 MEAN 项目,但出现同样的错误。
我似乎找不到问题所在。
Node Version - 5.0.0
NPM Version - 3.3.10
【问题讨论】:
-
我发现一些线程建议降级 node 和 npm。我还没有验证这是否有效。我想解决这个问题而不必降级。
-
我建议至少降级到
4.2.x,因为它是最新的长期版本,几周前才发布。如果它在那里工作,然后尝试使用5.x看看有什么问题,有可能npm 模块还没有更新到处理5.x,因为它只有几天?或者至少不要在 npm 或 node 中使用 sudo 来避免一些麻烦,并考虑使用nvm。 -
node-pre-gyp 尝试构建时会发生什么? (它是 npm 错误上方的文本)。此外,您用于构建的节点版本是 4.1.1
npm ERR! node v4.1.1