node.js - npm install安装时忘记--save,后来怎么补,难道要重装一次吗
巴扎黑
巴扎黑 2017-04-17 15:55:57
0
3
1169

比如我在npm install express时忘记了--save了,现在我想在package.json里写上依赖,难道我要重新npm install express --save吗,感觉应该有另一条补救的语句。。。。

巴扎黑
巴扎黑

reply all(3)
PHPzhong

It is also possible to reinstall it. If npm finds that this package has already been installed, it will skip the installation

迷茫

You just need to write the package into dependency or devDependency in package.json. Because the source files of the package have actually been downloaded to the node_module folder of your project, adding this sentence to package.json is just to ensure that you can install the dependent resources through npm i in the future

洪涛

Reinstallation is also very fast. You don’t need to download it. You just check it and add the library name to the package file.

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