search

Home  >  Q&A  >  body text

node.js - npm install安装时忘记--save,后来怎么补,难道要重装一次吗

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

巴扎黑巴扎黑2777 days ago1170

reply all(3)I'll reply

  • PHPz

    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

    reply
    0
  • 迷茫

    迷茫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

    reply
    0
  • PHP中文网

    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.

    reply
    0
  • Cancelreply