Syntax Error: Error: Cannot find module ‘node-sass’【解决方法】

今天爱分享给大家带来Syntax Error: Error: Cannot find module ‘node-sass’【解决方法】,希望能够帮助到大家。
启动vue项目的时候,会出现这样的报错
Syntax Error: Error: Cannot find module ‘node-sass’


 ERROR  Failed to compile with 1 error                                                                          15:14:28
 error  in ./node_modules/vuetify/src/styles/main.sass

Syntax Error: Error: Cannot find module 'node-sass'
Require stack:
- D:\vuetify-app\node_modules\sass-loader\dist\getDefaultSassImplementation.js
- D:\vuetify-app\node_modules\sass-loader\dist\getSassImplementation.js
- D:\vuetify-app\node_modules\sass-loader\dist\index.js
- D:\vuetify-app\node_modules\sass-loader\dist\cjs.js
- D:\vuetify-app\node_modules\loader-runner\lib\loadLoader.js
- D:\vuetify-app\node_modules\loader-runner\lib\LoaderRunner.js
- D:\vuetify-app\node_modules\webpack\lib\NormalModule.js
- D:\vuetify-app\node_modules\webpack\lib\NormalModuleFactory.js
- D:\vuetify-app\node_modules\webpack\lib\Compiler.js
- D:\vuetify-app\node_modules\webpack\lib\webpack.js
- D:\vuetify-app\node_modules\@vue\cli-service\lib\commands\serve.js
- D:\vuetify-app\node_modules\@vue\cli-service\lib\Service.js
- D:\vuetify-app\node_modules\@vue\cli-service\bin\vue-cli-service.js


 @ ./node_modules/vuetify/src/styles/main.sass 4:14-194 14:3-18:5 15:22-202
 @ ./node_modules/vuetify/lib/presets/default/index.js
 @ ./node_modules/vuetify/lib/services/presets/index.js
 @ ./node_modules/vuetify/lib/services/index.js
 @ ./node_modules/vuetify/lib/framework.js
 @ ./src/plugins/vuetify.js
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://192.168.16.27:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js



解决办法
命令进入到项目里面
执行


cnpm install node-sass

安装了sass模块之后
再重启一下即可

人已赞赏
前端

jquery 如何监听div内容的变化

2020-12-25 11:31:54

前端

JS 中的数据类型有哪些【面试题详解】

2020-12-29 17:30:56

'); })();