uniapp开发app框架在提升开发效率中的独特优势与应用探索
1457
2022-09-26
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.
如果是老项目,把node_module给直接删了,然后重新用yarn进行构建即可正常运行,
因为网上推荐的方法会叫你去用npm uninstall来卸载node-sass,但是会卡在idealtree的构建部分。
一劳永逸的方法:
node版本降级(重装)为:v14.16.0
npm install --global yarn
然后项目目录下直接输入yarn进行构建即可。
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~