Home > Article > Web Front-end > Introduction to the installation method of using stylus for the first time after initialization after the vue project is created
The following is a post-initialization installation method for using stylus for the first time after the vue project is created. It has a good reference value and I hope it will be helpful to everyone.
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.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
Solution:
npm install stylus-loader css-loader style-loader --save-dev
After installation, an error will be 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 execute npm run dev
Solution
Therefore, during the first initialization, you need to perform the following installation steps
1.npm install stylus --save-dev
2.npm install stylus-loader - -save-dev
3.npm run dev (you need to restart the project every time you change the configuration file)
The above is the entire content of this article. I hope it will be helpful to everyone's study. For more related content, please pay attention to the PHP Chinese website!
Related recommendations:
Vue implements the component that returns the top backToTop
About the construction, packaging and publishing process of the vue project Introduction
The above is the detailed content of Introduction to the installation method of using stylus for the first time after initialization after the vue project is created. For more information, please follow other related articles on the PHP Chinese website!