Home > Web Front-end > JS Tutorial > body text

Introduction to the installation method of using stylus for the first time after initialization after the vue project is created

不言
Release: 2018-06-29 15:42:33
Original
1663 people have browsed it

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
Copy after login

Solution:

npm install stylus-loader css-loader style-loader --save-dev
Copy after login

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)
Copy after login

Continue execution:

npm install stylus
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!