npm i命令执行成功
但是npm run 命令时出错: no such file or directory, scandir ‘/app/admin/node_modules/node-sass/vendor’
代码语言:javascript复制ERROR in ./node_modules/css-loader?{"sourceMap":true}!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-7ddeafd5","scoped":false,"hasInlineConfig":false}!./node_modules/sass-lo
ader/dist/cjs.js?{"sourceMap":true}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/views/templatePage/components/TableForm.vue
Module build failed: Error: ENOENT: no such file or directory, scandir '/app/admin/node_modules/node-sass/vendor'
at Object.readdirSync (fs.js:871:3)
at Object.getInstalledBinaries (/app/admin/node_modules/node-sass/lib/extensions.js:133:13)
at foundBinariesList (/app/admin/node_modules/node-sass/lib/errors.js:20:15)
at foundBinaries (/app/admin/node_modules/node-sass/lib/errors.js:15:5)
at Object.module.exports.missingBinary (/app/admin/node_modules/node-sass/lib/errors.js:45:5)
at module.exports (/app/admin/node_modules/node-sass/lib/binding.js:15:30)
at Object.<anonymous> (/app/admin/node_modules/node-sass/lib/index.js:14:35)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at require (internal/modules/cjs/helpers.js:77:18)
at getDefaultSassImpl (/app/admin/node_modules/sass-loader/dist/index.js:198:10)
at Object.loader (/app/admin/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-7ddeafd5","scoped":false,"hasInlineConfig":fal
se}!./node_modules/sass-loader/dist/cjs.js?{"sourceMap":true}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/views/templatePage/components/TableForm.vue 4:14-399
@ ./src/views/templatePage/components/TableForm.vue
@ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/views/templatePage/components/ChartsChoice.vue
@ ./src/views/templatePage/components/ChartsChoice.vue
@ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/views/templatePage/showPage.vue
@ ./src/views/templatePage/showPage.vue
@ ./src/router/router.config.js
@ ./src/store/modules/user.js
@ ./src/store/index.js
@ ./src/main.js
@ multi babel-polyfill ./src/main.js
ERROR in ./node_modules/css-loader?{"sourceMap":true}!./node_modules/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-417dffcc","scoped":false,"hasInlineConfig":false}!./node_modules/sass-lo
ader/dist/cjs.js?{"sourceMap":true}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/views/templatePage/components/only/AssessmentDepartment.vue
Module build failed: Error: ENOENT: no such file or directory, scandir '/app/admin/node_modules/node-sass/vendor'
at Object.readdirSync (fs.js:871:3)
at Object.getInstalledBinaries (/app/admin/node_modules/node-sass/lib/extensions.js:133:13)
at foundBinariesList (/app/admin/node_modules/node-sass/lib/errors.js:20:15)
at foundBinaries (/app/admin/node_modules/node-sass/lib/errors.js:15:5)
at Object.module.exports.missingBinary (/app/admin/node_modules/node-sass/lib/errors.js:45:5)
at module.exports (/app/admin/node_modules/node-sass/lib/binding.js:15:30)
at Object.<anonymous> (/app/admin/node_modules/node-sass/lib/index.js:14:35)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at require (internal/modules/cjs/helpers.js:77:18)
at getDefaultSassImpl (/app/admin/node_modules/sass-loader/dist/index.js:198:10)
at Object.loader (/app/admin/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-417dffcc","scoped":false,"hasInlineConfig":fal
se}!./node_modules/sass-loader/dist/cjs.js?{"sourceMap":true}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/views/templatePage/components/only/AssessmentDepartment.vue 4:14-4
22
然后查看查看node_modules命令,找到了node-sass目录;但是在node-sass的目录下没有vendor目录。判定应该是node-sass组件安装不成功
解决办法:
单独安装node-sass,执行命令npm rebuild node-sass --save-dev