更新到 Node v4.0.0 后出现错误 运行 gulp-sass

Error running gulp-sass after update to Node v4.0.0

我更新到 Node v4.0.0 之后,当我在我的项目中 运行 gulp 时,我收到关于 gulp-sass/node-sass 的错误,如下所示:

Error: libsass bindings not found. Try reinstalling node-sass?

我尝试删除项目中的所有节点模块并重新安装,但出现了一些错误:

npm WARN package.json package@0.0.0 No repository field.

npm WARN package.json package@0.0.0 No license field.

npm WARN deprecated CSSselect@0.4.1: the module is now available as 'css-select'

npm WARN deprecated CSSwhat@0.4.7: the module is now available as 'css-what'

npm WARN deprecated pangyp@2.3.2: use node-gyp@3+, it does all the things

-

node-sass@2.1.1 install /Users/Jonathan/Documents/sites/wkux/ct-html-lib/node_modules/gulp-sass/node_modules/node-sass

node scripts/install.js

Can not download file from https://raw.githubusercontent.com/sass/node-sass-binaries/v2.1.1/darwin-x64-node-4.0/binding.node

node-sass@2.1.1 postinstall /Users/Jonathan/Documents/sites/wkux/ct-html-lib/node_modules/gulp-sass/node_modules/node-sass

node scripts/build.js

gyp: /Users/Jonathan/.node-gyp/4.0.0/common.gypi not found (cwd: /Users/Jonathan/Documents/sites/wkux/ct-html-lib/node_modules/gulp-sass/node_modules/node-sass) while reading includes of binding.gyp while trying to load binding.gyp

gyp ERR! configure error

gyp ERR! stack Error: gyp failed with exit code: 1

gyp ERR! stack at ChildProcess.onCpExit (/Users/Jonathan/Documents/sites/wkux/ct-html-lib/node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/lib/configure.js:346:16)

gyp ERR! stack at emitTwo (events.js:87:13)

gyp ERR! stack at ChildProcess.emit (events.js:172:7)

gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)

gyp ERR! System Darwin 14.5.0

gyp ERR! command "/usr/local/bin/node" "/Users/Jonathan/Documents/sites/wkux/ct-html-lib/node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/bin/node-gyp" "rebuild"

gyp ERR! cwd /Users/Jonathan/Documents/sites/wkux/ct-html-lib/node_modules/gulp-sass/node_modules/node-sass

gyp ERR! node -v v4.0.0

gyp ERR! pangyp -v v2.3.2

gyp ERR! not ok

Build failed

所有其他节点模块似乎都已安装好。 gulp-sass 中的 node-sass 导致问题。

删除您的 node_modules 文件夹,将 gulp-sass 更新到您的 package.json 中的最新版本,即 2.2.0 和 运行 npm install再次.