我在运行npm run serve:后收到此错误
in ./src/components/site-checker/insert-model.vue?vue&type=style&index=0&lang=stylus&
Syntax Error: ValidationError: Invalid options object. Stylus Loader has been initialized using an options object that does not match the API schema.
- options has an unknown property 'preferPathResolver'. These properties are valid:
object { stylusOptions?, sourceMap?, webpackImporter?, additionalData? }
我使用VueJS和这个框架:
[Vue 2]babel,路由器,vuexVue CLI 4.5.8版
这是stylus-loader
和vue-cli
之间最近出现兼容性问题的结果。它最近在Vue的开发分支中得到了修复。
目前最好的选择是将stylus-loader
降级到版本3
npm install stylus-loader@3
您也可以尝试将vue-cli
升级到最新版本:
npm更新-g@vue/cli
或
纱线全球升级--最新的@vue/cli