【问题标题】:Npm can't install node-sassnpm 无法安装 node-sass
【发布时间】:2019-09-08 12:25:58
【问题描述】:

当我在我的项目 Angular 上安装 npm 时。 node-sass 安装失败。 之后就无法运行ng serve

npm ERR! node-sass@4.11.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-sass@4.11.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 install
npm update

它不起作用。

【问题讨论】:

    标签: angular npm node-sass


    【解决方案1】:

    我遇到了同样的问题,结果发现安装脚本被禁用了。除了 NPM 模块,Node Sass 还安装了一些二进制文件,因此需要启用安装脚本。

    尝试运行npm i --ignore-scripts=false

    【讨论】:

      【解决方案2】:

      先安装

      npm install -f node-sass
      

      yarn add node-sass
      

      【讨论】:

        猜你喜欢
        • 2019-03-16
        • 2014-11-19
        • 1970-01-01
        • 2022-10-06
        • 2018-08-23
        • 1970-01-01
        • 1970-01-01
        • 2018-03-29
        相关资源
        最近更新 更多