美文网首页
2020-05-01Vue安装sass出错:npm ERR! n

2020-05-01Vue安装sass出错:npm ERR! n

作者: Kason晨 | 来源:发表于2020-05-01 22:55 被阅读0次

    vue项目换台电脑安装node-sass出错:

    错误信息节选:
    
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! node-sass@4.14.0 postinstall: `node scripts/build.js`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the node-sass@4.14.0 postinstall script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2020-05-01T14_42_18_169Z-debug.log
    
    

    解决方法:

    这个错误是因为sass安装时获取源的问题,
    修改sass安装的源,再运行npm install就成功了

    npm config set sass_binary_site=https://npm.taobao.org/mirrors/node-sass
    

    重新安装:

    npm install   node-sass
    

    然后项目就运行成功了。

    相关文章

      网友评论

          本文标题:2020-05-01Vue安装sass出错:npm ERR! n

          本文链接:https://www.haomeiwen.com/subject/lnicghtx.html