npm install 失败 node-sass的问题

近期拉一个新项目 npm install的时候 卡在 corn.js 然后报了一大堆的错误,又是什么gyp ERROR

python not found啥的啥的

npm ERR! errno 1
npm ERR! [email protected] postinstall: node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.

最爽快的解决办法就是重新下载node.js 然后更新npm 换成淘宝镜像

npm install -g cnpm --registry= https://registry.npm.taobao.org

接着查看你的node和npm版本是否版本匹配

npm install 失败 node-sass的问题_第1张图片

接着查看你的node-sass版本,查不到的话可以装配一下

npm install 失败 node-sass的问题_第2张图片

可以看到为7.0.1的,打开vue中的package.json文件,将node-sass换成7.0.1版本,再运行

npm instal 

就可以了

你可能感兴趣的:(sass,npm,前端)