2

I manually changed my dependencies in package-lock.json and package.json files. How do I now apply those changes to my node-modules without updating/touching other dependencies?

Askar
  • 5,784
  • 10
  • 53
  • 96
Massaget
  • 340
  • 1
  • 6
  • 17

1 Answers1

4

Run command

npm i

or

npm install --save

npm i command will install all your dependencies into your local machine which are available in the file.

PS: It is not recommended approach to directly update package.json file, always install package using command npm i packageName --save or npm i packageName --save --dev. This will install as well as Update your package.json file too.

Pardeep Jain
  • 84,110
  • 37
  • 165
  • 215
  • Forgot to mention, will it change my other dependencies? like ```some package``` was '1.0.0' and will it change it to '^1.0.0'. I just need to avoid it – Massaget Oct 31 '19 at 06:21
  • I think if you run only `npm i` then it will not update your file, untill you run `npm i --save`, not sure though – Pardeep Jain Oct 31 '19 at 06:26