在vue项目创建的后初始化首次使用stylus安装方法分享
项目创建报错:
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(每次改动了配置文件均需要重新启动项目)
相关推荐
VLilyLUE 2020-06-11
StylusGalaxy 2020-04-29
前端工程师喻文强 2020-04-27
nicepainkiller 2020-02-23
xuelang 2020-01-16
Stylusnebula 2019-12-26
界之边缘的轮回 2019-12-11
VLilyLUE 2019-12-08
didianmanong 2019-11-17
CaiKanXP 2019-11-10
StylusGalaxy 2019-11-09
flyingbird 2019-11-08
星辰的笔记 2016-04-25
Stylusnebula 2019-08-31
碎冰stylus融 2019-07-01
zhouyl0 2019-07-01
Stylusnebula 2019-07-01
crazestylus 2019-07-01
碎冰stylus融 2019-07-01