Encountered a problem and failed to reference stylus. It has been solved, but I am a little confused
The background is as follows:
npm is currently upgraded to 5.0.3
When npm install, the directory will have an additional file package-lock.json
At this time, I added # in the devDependencies of package.json. ##
"stylus": "^0.54.5",
"stylus-loader": "^3.0.1"
Then when re-running npm install in the terminal, the stylus folder does not appear in the node_modules in the projectI checked the information and said it is a pitfall of the new version
https://mp.weixin.qq.com /s?__...
The solution given is to switch back to the previous npm version...
1. Delete package-lock.json and re-npm install. The stylus folder appears in node_modules, but an error is still reported.
2. Run sudo npm install stylus-loader directly in the terminal. stylus --save-dev results in successful compilation
I also discovered this. I checked and found out that this is a pitfall of npm5.0. My understanding is that you can only specify the version if you want to install it. This is the answer I saw on Stack Overflow, but my foreign language skills are not good, so I can only understand part of it. Your problem is that vue.js is not very good. You can try using npm or node.js. Maybe someone will know better.
I haven’t read the documentation, but there is a way for now to delete the lock file and npm i and it will work