更新到 Node v4.0.0 后运行 gulp-sass 时出错 [英] Error running gulp-sass after update to Node v4.0.0

查看:18
本文介绍了更新到 Node v4.0.0 后运行 gulp-sass 时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I updated to Node v4.0.0 and after when I run gulp in my projects I get an error with regards to gulp-sass/node-sass, as follows:

错误:未找到 libsass 绑定.尝试重新安装 node-sass?

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

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

I've tried trashing all the node modules in the project and reinstalling, and I get some errors:

npm WARN package.json package@0.0.0 没有存储库字段.

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

npm WARN package.json package@0.0.0 没有许可字段.

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

npm WARN 已弃用 CSSselect@0.4.1:该模块现在可用作css-select"

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

npm WARN 已弃用 CSSwhat@0.4.7:该模块现在可用作css-what"

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

npm WARN 已弃用 pangyp@2.3.2:使用 node-gyp@3+,它可以做所有事情

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-sass@2.1.1 install /Users/Jonathan/Documents/sites/wkux/ct-html-lib/node_modules/gulp-sass/node_modules/node-sass

节点脚本/install.js

node scripts/install.js

无法从 https://raw.githubusercontent.com/sass/node-sass-binaries/v2.1.1/darwin-x64-node-4.0/binding.node

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

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

节点脚本/build.js

node scripts/build.js

gyp:/Users/Jonathan/.node-gyp/4.0.0/common.gypi 未找到(cwd:/Users/Jonathan/Documents/sites/wkux/ct-html-lib/node_modules/gulp-sass/node_modules/node-sass) 在尝试加载 binding.gyp 时读取包括 binding.gyp

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 错误!配置错误

gyp ERR! configure error

gyp 错误!堆栈错误:gyp 失败,退出代码:1

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

gyp 错误!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 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 错误!堆栈在 emitTwo (events.js:87:13)

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

gyp 错误!ChildProcess.emit (events.js:172:7) 的堆栈

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

gyp 错误!Process.ChildProcess._handle.onexit 处的堆栈 (internal/child_process.js:200:12)

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

gyp 错误!系统达尔文 14.5.0

gyp ERR! System Darwin 14.5.0

gyp 错误!命令/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"重建"

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 错误!cwd/Users/Jonathan/Documents/sites/wkux/ct-html-lib/node_modules/gulp-sass/node_modules/node-sass

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

gyp 错误!节点 -v v4.0.0

gyp ERR! node -v v4.0.0

gyp 错误!pangyp -v v2.3.2

gyp ERR! pangyp -v v2.3.2

gyp 错误!不行

构建失败

所有其他节点模块似乎都安装得很好.它在 gulp-sass 中的 node-sass 导致问题.

All the other node modules seem to have installed fine. Its something with node-sass thats in gulp-sass that is causing issues.

推荐答案

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

Delete your node_modules folder, update gulp-sass to the latest in your package.json, which is 2.2.0, and run npm install again.

这篇关于更新到 Node v4.0.0 后运行 gulp-sass 时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆