npm install 在 node-sass 中抛出错误 [英] npm install throwing error in node-sass

查看:147
本文介绍了npm install 在 node-sass 中抛出错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

node-sass@2.1.1 install /home/user/Documents/project/node_modules/node-sass
> node scripts/install.js

WARN invalid config loglevel="notice"
Can not download file from https://raw.githubusercontent.com/sass/node-sass-binaries/v2.1.1/linux-x64-node-8.2/binding.node

> node-sass@2.1.1 postinstall /home/user/Documents/project/node_modules/node-sass
> node scripts/build.js

module.js:487
    throw err;
    ^

Error: Cannot find module '/home/user/Documents/project/node_modules/node-sass/node_modules/pangyp/bin/node-gyp'
    at Function.Module._resolveFilename (module.js:485:15)
    at Function.Module._load (module.js:437:25)
    at Function.Module.runMain (module.js:605:10)
    at startup (bootstrap_node.js:158:16)
    at bootstrap_node.js:575:3
Build failed
added 2186 packages in 42.166s

到目前为止我尝试过:

  • npm 重建
  • npm 重建 node-sass
  • npm uninstall -g node-sass
  • rm -rf node_module
  • 推荐答案

    您需要执行后续步骤,它应该会起作用:

    You need to do next steps and it should work:

    rm -rf node_modules package-lock.json 
    npm install --saveDev node-sass@4.5.3 
    npm install
    

    瞧:)

    这篇关于npm install 在 node-sass 中抛出错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆