webpack:Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js

错误:

Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
Error: Missing binding C:\Users\jake\Desktop\learn-react\react-doubanOfme\node_modules\node-sass\vendor\win32-x64-72\binding.node
Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 12.x

Found bindings for the following environments:
  - Windows 64-bit with Node.js 12.x

This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass` to download the binding for your current environment.

解决错误的过程:

  1. 我看到了错误提示中的“Run npm rebuild node-sass to download the binding for your current environment”,所以我就在命令行中执行了如下命令
npm rebuild node-sass
  1. 但是又出现了如下错误提示,即表明我由出现了一个错误(上天要垂爱于我)
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
....
MSBUILD : error MSB4132: 无法识别工具版本“2.0”。可用的工具版本为 "4.0"

我看了一下错误提示,就是说没有发现python2,
然后又查看我的电脑上是否安装了Python2.X的版本,查看了没有问题,也将python2.x配置到了我的环境变量中,然后再运行还是不行,我在继续百度,Google,后来找到了解决方案,又执行了如下命令

  npm config set msvs_version 2012 --global 
  npm set SKIP_SASS_BINARY_DOWNLOAD_FOR_CI = true
  npm set SKIP_NODE_SASS_TESTS = true
  npm cache clean --force
  1. 最后执行如下指令,终于解决了将rebuild node-sass了
npm rebuild node-sass
  1. 最后执行我要执行的指令终于没有问题了,感谢坐在电脑前的我让我又成长了
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值