node.js - The npm5.0 version has an additional packjson-lock.json. The new dependencies cannot be installed using the npm install command. Is there any solution?
为情所困
为情所困 2017-06-21 10:13:05
0
2
2051

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 project

I 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...

My solution process

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

If anyone has the same problem, you can try it like me, and then I would like to ask the experts if there is any good way to do this. Could it be that the dependencies I write in package.json in the future must be in the terminal itself? Specify to install it...

为情所困
为情所困

reply all(2)
某草草

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template