vue启动项目报错,一大坨  如下

Module build failed: Error: ENOENT: no such file or directory, scandir '/Users/songmengda/Desktop/aaa/xxx-aaa/develop/gmac/node_modules/node-sass/vendor'
    at Object.fs.readdirSync (fs.js:904:18)
    at Object.getInstalledBinaries (/Users/songmengda/Desktop/aaa/xxx-aaa/develop/gmac/node_modules/node-sass/lib/extensions.js:132:13)
    at foundBinariesList (/Users/songmengda/Desktop/aaa/xxx-aaa/develop/gmac/node_modules/node-sass/lib/errors.js:20:15)
    at foundBinaries (/Users/songmengda/Desktop/aaa/xxx-aaa/develop/gmac/node_modules/node-sass/lib/errors.js:15:5)
    at Object.module.exports.missingBinary (/Users/songmengda/Desktop/aaa/xxx-aaa/develop/gmac/node_modules/node-sass/lib/errors.js:45:5)
    at module.exports (/Users/songmengda/Desktop/aaa/xxx-aaa/develop/gmac/node_modules/node-sass/lib/binding.js:15:30)
    at Object.<anonymous> (/Users/songmengda/Desktop/aaa/xxx-aaa/develop/gmac/node_modules/node-sass/lib/index.js:14:35)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at getDefaultSassImpl (/Users/songmengda/Desktop/aaa/xxx-aaa/develop/gmac/node_modules/sass-loader/dist/index.js:198:10)
    at Object.loader (/Users/songmengda/Desktop/aaa/xxx-aaa/develop/gmac/node_modules/sass-loader/dist/index.js:80:29)

 @ ./node_modules/vue-style-loader!./node_modules/css-loader?{"sourceMap":true}!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-5d903663","scoped":false,"hasInlineConfig":false}!./node_modules/sass-loader/dist/cjs.js?{"sourceMap":true}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/components/formItem/selectBrand.vue 4:14-389 13:3-17:5 14:22-397
 @ ./src/components/formItem/selectBrand.vue
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://localhost:80 webpack/hot/dev-server babel-polyfill ./src/main.js

别慌  看后边的目录  在我当前目录下的node_modules下的node-sass下的vendor出了问题,

那就去看一下吧。

发现node_modules中少了这个文件夹。  

解决办法:

执行: sudo npm rebuild node-sass

 

重新安装一下  再检查 ,发现这个文件夹装好了。

运行项目   sudo npm run dev 即可

如果并没有解决你的问题  那可以看下是不是和我这篇文章报错一样

《Module build failed: Error: Cannot find module 'node-sass'》https://blog.csdn.net/qq_40028324/article/details/103274971

 

 

Logo

前往低代码交流专区

更多推荐