比如我在npm install express时忘记了--save了,现在我想在package.json里写上依赖,难道我要重新npm install express --save吗,感觉应该有另一条补救的语句。。。。
PHPz2017-04-17 15:57:57
It is also possible to reinstall it. If npm finds that this package has already been installed, it will skip the installation
迷茫2017-04-17 15:57:57
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
PHP中文网2017-04-17 15:57:57
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.