欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Module build failed: Error: Cannot find module 'node-sass' at Function.Module._resolveFilename (

程序员文章站 2022-06-05 09:15:00
...

Module build failed: Error: Cannot find module ‘node-sass’
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at getDefaultSassImpl (E:\项目\电商项目\MALL\node_modules\sass-loader\dist\index.js:198:10)
at Object.loader (E:\项目\电商项目\MALL\node_modules\sass-loader\dist\index.js:80:29)

Module build failed: Error: Cannot find module 'node-sass' at Function.Module._resolveFilename (

解决办法:
使用淘宝镜像安装依赖
先全局安装淘宝镜像

npm install -g cnpm --registry=https://registry.npm.taobao.org

在下载依赖

cnpm install

最后成功

npm run dev

Module build failed: Error: Cannot find module 'node-sass' at Function.Module._resolveFilename (