Module build failed: Error: ENOENT: no such file or directory, scandir '/Users/yld/Documents/work/YLD/samyoc_admin_chrome/node_modules/node-sass/vendor'

最新在搭建VUE工程,启动后报错了,感觉还是蛮匪夷所思的

ERROR in ./node_modules/css-loader!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-7ba5bd90","scoped":false,"hasInlineConfig":false}!./node_modules/sass-loader/lib/loader.js!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/App.vue
Module build failed: Error: ENOENT: no such file or directory, scandir '/Users/yld/Documents/work/YLD/samyoc_admin_chrome/node_modules/node-sass/vendor'
    at Object.fs.readdirSync (fs.js:904:18)
    at Object.getInstalledBinaries (/Users/yld/Documents/work/YLD/samyoc_admin_chrome/node_modules/node-sass/lib/extensions.js:132:13)
    at foundBinariesList (/Users/yld/Documents/work/YLD/samyoc_admin_chrome/node_modules/node-sass/lib/errors.js:20:15)
    at foundBinaries (/Users/yld/Documents/work/YLD/samyoc_admin_chrome/node_modules/node-sass/lib/errors.js:15:5)
    at Object.module.exports.missingBinary (/Users/yld/Documents/work/YLD/samyoc_admin_chrome/node_modules/node-sass/lib/errors.js:45:5)
    at module.exports (/Users/yld/Documents/work/YLD/samyoc_admin_chrome/node_modules/node-sass/lib/binding.js:15:30)
    at Object.<anonymous> (/Users/yld/Documents/work/YLD/samyoc_admin_chrome/node_modules/node-sass/lib/index.js:14:35)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
Winter2020/04/08 17:12:31

看原因是找不到“/node_modules/node-sass/vendor”模块,解决的思路是,运行以下脚本

npm rebuild node-sass

如果还是不能解决问题的话,可以使用以下办法

cd node_modules/node-sass/
node scripts/install.js