npm 报错 ./src/styles/element-variables.scss

首先执行 npm run dev 报错,error in ./src/styles/element-variables.scss

 ERROR  Failed to compile with 1 error                                                                                                                    下午2:58:37
 error  in ./src/styles/element-variables.scss

Syntax Error: Error: ENOENT: no such file or directory, scandir 'D:\Learning\workspace\visual code\wimsweb\node_modules\node-sass\vendor'


 @ ./src/styles/element-variables.scss 4:14-234 15:3-20:5 16:22-242
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://10.2.113.44:9529/sockjs-node ./node_modules/@vue/cli-service/node_modules/webpack/hot/dev-server.js ./src/main.js

【解决方案】

1. 执行:npm uninstall less-loader

2. 执行:npm install [email protected] -D

3. 执行:npm run dev

但是又报错, error  in ./src/styles/index.scss

 ERROR  Failed to compile with 1 error                                                                                                                    下午3:02:28

 error  in ./src/styles/index.scss

Syntax Error: Error: ENOENT: no such file or directory, scandir 'D:\Learning\workspace\visual code\wimsweb\node_modules\node-sass\vendor'


 @ ./src/styles/index.scss 4:14-222 15:3-20:5 16:22-230
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://10.2.113.44:9529/sockjs-node ./node_modules/@vue/cli-service/node_modules/webpack/hot/dev-server.js ./src/main.js  

 【解决方案】

1. 执行:node node_modules/node-sass/scripts/install.js

2. 执行:npm run dev

成功!

你可能感兴趣的:(前端,npm,node.js)