解决:Module build failed (from ./node_modules/sass-loader/dist/cjs.js)问题

一、问题

Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
Error: Cannot find module 'sass'

二、解决方法

1.清除缓存

npm cache clean --force

2.重构项目

npm install

3.更新(获取最新的)node-sass和sass-loader依赖包

npm install node-sass@latest
npm install sass-loader@latest

4.重新运行项目即可

解决:Module build failed (from ./node_modules/sass-loader/dist/cjs.js)问题_第1张图片

你可能感兴趣的:(稀奇古怪的问题,前端开发,sass,javascript,前端)