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
1894

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

为情所困
为情所困

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!