sass-loader 版本不兼容导致老项目起不来,重新构建失败的问题 Module build failed (from ./node_modules/_

网友投稿 1411 2022-09-26

sass-loader 版本不兼容导致老项目起不来,重新构建失败的问题 Module build failed (from ./node_modules/_

sass-loader 版本不兼容导致老项目起不来,重新构建失败的问题 Module build failed (from ./node_modules/_

Failed to compile../src/styles/index.scss (./node_modules/_css-loader@1.0.1@css-loader??ref--8-oneOf-3-1!./node_modules/_postcss-loader@3.0.0@postcss-loader/src??ref--8-oneOf-3-2!./node_modules/_sass-loader@7.3.1@sass-loader/dist/cjs.js??ref--8-oneOf-3-3!./src/styles/index.scss)Module build failed (from ./node_modules/_sass-loader@7.3.1@sass-loader/dist/cjs.js):Error: Missing binding C:\extend\work\frontEndProject\vue-admin-template-custom\node_modules\_node-sass@4.14.1@node-sass\vendor\win32-x64-83\binding.nodeNode 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.xThis usually happens because your environment has changed since running `npm install`.Run `npm rebuild node-sass` to download the binding for your current environment. at module.exports (C:\extend\work\frontEndProject\vue-admin-template-custom\node_modules\_node-sass@4.14.1@node-sass\lib\binding.js:15:13) at Object. (C:\extend\work\frontEndProject\vue-admin-template-custom\node_modules\_node-sass@4.14.1@node-sass\lib\index.js:14:35) at Module._compile (internal/modules/cjs/loader.js:1063:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10) at Module.load (internal/modules/cjs/loader.js:928:32) at Function.Module._load (internal/modules/cjs/loader.js:769:14) at Module.require (internal/modules/cjs/loader.js:952:19) at require (internal/modules/cjs/helpers.js:88:18) at getDefaultSassImpl (C:\extend\work\frontEndProject\vue-admin-template-custom\node_modules\_sass-loader@7.3.1@sass-loader\dist\index.js:198:10) at Object.loader (C:\extend\work\frontEndProject\vue-admin-template-custom\node_modules\_sass-loader@7.3.1@sass-loader\dist\index.js:80:29)

如果是老项目,把node_module给直接删了,然后重新用yarn进行构建即可正常运行,

因为网上推荐的方法会叫你去用npm uninstall来卸载node-sass,但是会卡在idealtree的构建部分。

一劳永逸的方法:

node版本降级(重装)为:v14.16.0

npm install --global yarn

然后项目目录下直接输入yarn进行构建即可。

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:npm install 时,下载github的包超时解决方法
下一篇:springboot读取resources下文件的方式详解
相关文章

 发表评论

暂时没有评论,来抢沙发吧~