在node-sass@0.9.6安装脚本“node build.js”失败

我在项目上运行npm install时遇到这个错误。 以下有关此问题的其他信息,

 npm ERR! node-sass@0.9.6 install: `node build.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the node-sass@0.9.6 install script 'node build.js'. npm ERR! This is most likely a problem with the node-sass package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node build.js npm ERR! You can get their info via: npm ERR! npm owner ls node-sass npm ERR! There is likely additional logging output above. npm ERR! Please include the following file with any support request: npm ERR! /home/capricornus/Projects/aware-app/npm-debug.log 

它看起来像这个版本不再兼容。 我在我的系统上遇到同样的错误。 要么将节点降级到支持的版本,要么升级需要node-sass@0.9.6的依赖node-sass@0.9.6

最新版本的node-sass是3.4.2。

只需使用nodebrew安装较旧版本的Nodejs。

 curl -L git.io/nodebrew | perl - setup 

将以下内容添加到〜/ .bashrc

 export PATH=$HOME/.nodebrew/current/bin:$PATH 

刷新控制台

 source ~/.bashrc 

安装旧版本

 nodebrew install-binary v0.12.7 nodebrew use v0.12.7 

然后再试一次!

在node-sass@0.9.6安装脚本“node build.js”失败

如果有人遇到nodebrew问题,也可以使用nvm(节点版本pipe理器)来降级你的节点版本。 在Github上的项目

在OSX El Capitan上,我需要这个安装:

 curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash . ~/.nvm/nvm.sh 

注意最后一行,因为它与github上的安装指令略有不同。

正如Yosuke Sato所提到的,v0.12.7与node-sass@0.9.6兼容,所以你需要

 nvm install v0.12.7 or nvm use v0.12.7 (if you have it installed already) 

这将使用较旧的节点版本,但仅在当前terminal窗口/选项卡中

nvm use v0.12.7在项目目录中nvm use v0.12.7 ,然后是npm install解决了我的问题 – 当我尝试设置broccoli-taco(一个静态站点生成器)时发生错误。 感谢提示,我很高兴我把你搞定了。