vuevue-style-loader!css-loader错误
在执⾏npm run dev的时候出现如下错误:
问题1:
This dependency was not found:
* !!vue-style-loader!css-loader?{"minimize":false,"sourceMap":false}!../../node_modules/vue-loader/lib/style-compiler/index? {"vue":true,"id":"data-v-1d57e5ea","scoped":false,"hasInlineConfig":false}!stylus-loader?{"sourceMap":false}!../../node_modules/vue-loader/lib/selector?type=styles&index=0!./a.vue in ./src/components/a.vue
To install it, you can run: npm install --save !!vue-style-loader!css-loader?{"minimize":false,"sourceMap":false}!../../node_modules/vue-loader/lib/style-compiler/index?{"vue":true,"id":"data-v-1d57e5ea","scoped":false,"hasInlineConfig":false}!stylus-loader? {"sourceMap":false}!../../node_modules/vue-loader/lib/selector?type=styles&index=0!./a.vu
解决办法:
npm install sass-loader --save;
npm install node-sass --save;
然后运⾏npm run dev。
接着出现问题2:
Module build failed: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefinednodeselector
at validateString (internal/validators.js:117:11)
at Object.join (path.js:375:7)
@ ./node_modules/vue-style-loader!./node_modules/css-loader?{"sourceMap":true}!./node_modules/vue-loader/lib/style-compiler? {"vue":true,"id":"data-v-6b3aeb0e","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/views/404.vue 4:14-369 13:3-17:5 14:22-377
解决办法:
sassloader版本过⾼导致的,回退7.×版本
npm uninstall sass-loader(卸载当前版本)
npm install sass-loader@7.3.1 --save-dev

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。