2015-11-01 73 views
15

我刚刚在长时间使用Windows后给自己买了一本mac书。在OSX上安装MeanJS时,node-pre-gyp install --fallback-to-build`失败

我正在努力研究我一直在研究的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! [email protected] install: `node-pre-gyp install --fallback-to-build` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] 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. 

我试过清除缓存。

我尝试安装节点预GYP与sudo--unsafe-perm

我也试着重新安装,平均项目,同样的错误。

我似乎无法找到问题在这里。

Node Version - 5.0.0 

NPM Version - 3.3.10 
+0

我已经发现了一些线程表明降级节点和故宫。我还没有证实,如果这工作尚未。我想解决这个问题,而不必降级。 –

+0

我会建议至少降级到'4.2.x',因为它是几周前才发布的最新的长期版本。如果它在那里工作,然后尝试使用5.x来查看什么是中断,那么npm模块有可能还没有被更新来处理'5.x',因为它只有几天?或者至少不要通过npm或node使用sudo来节省一些麻烦,并考虑使用'nvm'。 – jmunsch

+0

当node-pre-gyp尝试构建时会发生什么? (它是npm错误之上的文本)。此外,您正在使用的节点版本是4.1.1'npm ERR! node v4.1.1' – jmunsch

回答

1

好吧,所以一些调试后,下面的依赖使用的是旧版本的touch

./node_modules/bower/node_modules/decompress-zip/package.json: "touch": "0.0.3" 
./node_modules/bower/node_modules/lockfile/package.json: "touch": "0" 
./node_modules/gulp-nodemon/node_modules/nodemon/package.json: "touch": "1.0.0", 
./node_modules/gulp-nodemon/node_modules/touch/package.json: "touch": "./bin/touch.js" 
./node_modules/nodemon/package.json: "touch": "~0.0.3", 

有了,我能得到meanJS与节点工作5

这里是关于我跑过的命令的历史记录:

git clone https://github.com/meanjs/mean.git 
cd mean 
nvm install 5 
nvm use 5 
npm install 
which node-gyp 
npm install -g node-pre-gyp 
sudo xcodebuild -license 
npm install 

已经s青梅问题,然后:

我添加下面一行:

#!/usr/bin/env node

到文件的顶部./mean/node_modules/.bin/touch

然后:

npm install 

当然也许扔在重试之前在sudo rm -rf ./node_modules && npm cache clean

+0

我试着安装旧版本的node-pre-gyp:'npm install node-pre-gyp @ v0.7.x'。它为我工作。我不知道为什么新版本不起作用。 –

7

russfrisch评论3天前:

我正经历着同样的问题。更改 grunt-node-inspector的版本以预先设置一个“> =”而不是“〜”得到这个 为我工作。

链接到github page我找到了这个解决方案。

Link to my post on StackoverFlow

+0

这不适合我。 –

+2

设置''grunt-node-inspector':“〜0.4.1”'节点4.2.2为我工作 – Dziamid

+0

它工作了https://github.com/node-inspector/v8-debug/issues/7#issuecomment -154450807 –

21

我曾尝试升级节点GYP:

npm install -g node-gyp 

它为我工作。

我找到解决方案here,希望能帮上忙。

+1

它不适合我! –

+0

只需添加评论。在'npm install -g node-gyp'中,'-g'表示将其安装到*全局*,而不是升级它。 –

1

,这可能不是适合每一个人,但我升级的节点,它解决了该问题对我来说,当没有以上没有