关于Module build failed (from ./node_modules/sass-loader/dist/cjs.js)问题解决
1.问题描述:
-
vue项目中不同分支的包装的不一样,导致了在切换分支时遇到了以下问题:
-
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
Error: Missing binding …\node_modules\node-sass\vendor\win32-x64-83\binding.node
Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 14.xFound bindings for the following environments:
- Windows 64-bit with Node.js 12.x
2.解决方案:
-
- 原因是因为node-sass在运行后node环境发生了变化,通常是使用npm install引起的 ,执行以下命令即可解决:
-
npm rebuild node-sass