首先执行 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 less-loader@5.0.0 -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

成功!

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐