npm install vs. edit package.json and npm update

János

Curious what is the difference between the two procedures:

  1. npm install xyz
  2. edit package.json, adding required module names like this:

"dependencies": {
    "express": "~3.4.4",
    "mongodb": "*",
    "body-parser": "*",
    "bson": "*"
  },

and then npm update

Scimonster

If you just do npm install package, it doesn't add it to your package.json. Then, if you want to npm update or publish your package, it won't have all of the required packages.

You can also do npm install --save package, which will install and add to your package.json. (see the docs)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

"npm install [package]" doesn't update package.json

From Dev

package.json vs. "npm install %s -g"

From Dev

package.json vs. "npm install %s -g"

From Java

How to update package-lock.json without doing npm install?

From Java

npm install if package.json was modified

From Dev

npm install error - invalid package.json

From Dev

npm install not reading package.json

From Dev

npm link, not install, package.json dependencies

From Dev

npm install cannot read package.json

From Dev

Change the install directory, npm with package.json

From Dev

npm install vs sudo npm install -g

From Dev

npm install vs npm install <library>

From Dev

npm install package in absolute path (Locally and package.json)

From Java

npm install vs. update - what's the difference?

From Java

Why does "npm install" rewrite package-lock.json?

From Java

How do I add comments to package.json for npm install?

From Java

npm install private github repositories by dependency in package.json

From Dev

Why after "npm install express" there is no package.json in my directory?

From Dev

npm install installing extra packages not specified in package.json

From Java

Make `npm install --save` add a strict version to package.json

From Dev

npm install "no such file or directory '.../package.json'" for custom modules

From Dev

npm install doesn't save dependency to package.json

From Dev

npm install packagename --save-dev not updating package.json

From Dev

NPM - Add to package.json but don't install

From Dev

package.json not found during npm install --save on gitlab

From Dev

Why after "npm install express" there is no package.json in my directory?

From Dev

Why does `npm install` hang with this specific `package.json`?

From Dev

Why isn't my package.json updated by npm install?

From Dev

Unable to npm install my package

Related Related

  1. 1

    "npm install [package]" doesn't update package.json

  2. 2

    package.json vs. "npm install %s -g"

  3. 3

    package.json vs. "npm install %s -g"

  4. 4

    How to update package-lock.json without doing npm install?

  5. 5

    npm install if package.json was modified

  6. 6

    npm install error - invalid package.json

  7. 7

    npm install not reading package.json

  8. 8

    npm link, not install, package.json dependencies

  9. 9

    npm install cannot read package.json

  10. 10

    Change the install directory, npm with package.json

  11. 11

    npm install vs sudo npm install -g

  12. 12

    npm install vs npm install <library>

  13. 13

    npm install package in absolute path (Locally and package.json)

  14. 14

    npm install vs. update - what's the difference?

  15. 15

    Why does "npm install" rewrite package-lock.json?

  16. 16

    How do I add comments to package.json for npm install?

  17. 17

    npm install private github repositories by dependency in package.json

  18. 18

    Why after "npm install express" there is no package.json in my directory?

  19. 19

    npm install installing extra packages not specified in package.json

  20. 20

    Make `npm install --save` add a strict version to package.json

  21. 21

    npm install "no such file or directory '.../package.json'" for custom modules

  22. 22

    npm install doesn't save dependency to package.json

  23. 23

    npm install packagename --save-dev not updating package.json

  24. 24

    NPM - Add to package.json but don't install

  25. 25

    package.json not found during npm install --save on gitlab

  26. 26

    Why after "npm install express" there is no package.json in my directory?

  27. 27

    Why does `npm install` hang with this specific `package.json`?

  28. 28

    Why isn't my package.json updated by npm install?

  29. 29

    Unable to npm install my package

HotTag

Archive