错误:
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.
解决错误的过程:
- 我看到了错误提示中的“Run
npm rebuild node-sass
to download the binding for your current environment”,所以我就在命令行中执行了如下命令
npm rebuild node-sass
- 但是又出现了如下错误提示,即表明我由出现了一个错误(上天要垂爱于我)
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
- 最后执行如下指令,终于解决了将rebuild node-sass了
npm rebuild node-sass
- 最后执行我要执行的指令终于没有问题了,感谢坐在电脑前的我让我又成长了