您的位置:首页 > Web前端 > Node.js

解决windows下node-sass报错的问题

2017-04-11 11:38 113 查看
报错如下

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\                                                                                                                                                             node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.8
npm ERR! code ELIFECYCLE

npm ERR! node-sass@4.5.3 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.5.3 postinstall script 'node scripts/build.js                                                                                                                                                             '.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, 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 scripts/build.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs node-sass
npm ERR! Or if that isn't available, 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:

解决办法:

主要是windows平台缺少编译环境,

1、先运行: npm install -g node-gyp

2、然后运行:运行 npm install –global –production windows-build-tools 可以自动安装跨平台的编译器:gym

另外看到一篇好的文章,如果还没有解决,看看这个https://segmentfault.com/a/1190000005921721

另外一篇https://github.com/lmk123/blog/issues/28
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: