在vue项目创建的后初始化首次使用stylus安装方法分享
程序员文章站
2022-04-10 11:07:47
项目创建报错:
this dependency was not found:
* !!vue-style-loader!css-loader?{"min...
项目创建报错:
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.vue
解决方案:
npm install stylus-loader css-loader style-loader --save-dev
安装之后还会报错:
module build failed: error: cannot find module 'stylus' at function.module._resolvefilename (module.js:485:15) at function.module._load (module.js:437:25) at module.require (module.js:513:17) at require (internal/module.js:11:18) at object.<anonymous> (e:\project\selling\node_modules\stylus-loader\index.js:2:14) at module._compile (module.js:569:30) at object.module._extensions..js (module.js:580:10) at module.load (module.js:503:32)
继续执行:
npm install stylus
然后执行 npm run dev
解决
因此在首次初始化的时候需要进行如下步骤的安装
1.npm install stylus --save-dev
2.npm install stylus-loader --save-dev
3.npm run dev(每次改动了配置文件均需要重新启动项目)
以上这篇在vue项目创建的后初始化首次使用stylus安装方法分享就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。