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


    报错如下

    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

  • 相关阅读:
    Python 之 面向对象(一)
    Python 之 基础知识(五)
    javaweb 之 代理模式
    Python 之 基础知识(四)
    Python 之 基础知识(三)
    如何在非 sudo 用户下运行 docker 命令?
    Leetcode 55
    Leetcode 11
    Leetcode 466
    几个内存操作函数使用
  • 原文地址:https://www.cnblogs.com/junhey/p/7149781.html
Copyright © 2020-2023  润新知