Initialize and use the stylus Installation Method for the first time after the vue project is created.
Project creation error:
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.vueTo 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
Solution:
npm install stylus-loader css-loader style-loader --save-dev
After installation, an error is reported:
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)
Continue execution:
npm install stylus
Then run npm run dev
Solution
Therefore, the following steps must be performed during initial initialization:
1. npm install stylus -- save-dev
2. npm install stylus-loader -- save-dev
3. npm run dev (the project needs to be restarted every time the configuration file is changed)
The above is the first time the stylus installation method is initialized after the vue project is created. It is all the content shared by Alibaba Cloud. I hope you can give us a reference and support for the help house.