Module build failed: Error: Cannot find module 'node-sass'
程序员文章站
2022-05-30 21:12:42
...
解决运行项目报错:Cannot find module 'node-sass'
Module build failed: Error: Cannot find module 'node-sass'
10 at Function.Module._resolveFilename (module.js:547:15)
11 at Function.Module._load (module.js:474:25)
12 at Module.require (module.js:596:17)
之前在网上看了很多解决方案,用npm去安装,但总是安装失败。
用命令“npm install node-sass --save-dev”下载一个新的 “node-sass”文件
解决方案:可以先下载一个cnpm,使用淘宝镜像
npm配置使用淘宝镜像 ‘npm config set registry http://registry.npm.taobao.org’
再下载:
cnpm install node-sass --save,使用cnpm重新下载‘node-sass’文件
npm run dev
npm run serve
运行项目就好了。
上一篇: Mybatis常见面试题总结
下一篇: Springboot常见面试题总结1
推荐阅读
-
cannot find supercluster & native module cannot be null & Xcode build timeout
-
Error: ENOENT: no such file or directory, uv_cwd Error: Cannot find module
-
【已解决】运行webpack-dev-server时提示Error: Cannot find module ‘webpack-cli/bin/config-yargs‘
-
An unhandled exception occurred: Cannot find module '@angular-devkit/build-angular/package.json'
-
webpack5: Error: Cannot find module ‘webpack-cli/bin/config-yargs‘
-
Webpack 报错:Error: Cannot find module ‘webpack-cli/bin/config-yargs‘
-
webpack-dev-server 报错 Error: Cannot find module ‘webpack/bin/config-yargs‘
-
webpack——Error: Cannot find module ‘webpack-cli/bin/config-yargs‘
-
【webpack-dev-server】Error: Cannot find module ‘webpack-cli/bin/config-yargs‘
-
Error: Cannot find module 'webpack-cli/bin/config-yargs' at Function.Module._resolveFilename