Jeff Clanton
Jeff Clanton

Reputation: 57

npm update dependency issue

I am trying to update dependencies for various projects I have on GitHub. I wanted to update them one at a time. I went through these steps:

  1. npm update (from master)
  2. npm update dependency-name (from folder containing the json files)
  3. npm install dependency-name --save
  4. npm fix --force (don't remember this command exactly. It was similar to that)

Then I got a message that said "--force. I hope you know what you're doing." I knew immediately that I'd made a mistake because I didn't know what I was doing. I found that command while Googling solutions, so I stopped there.

How can I update a specific dependency in a package-lock.json file? Also, could I have done significant damage with the --force command?

Thank you.

Upvotes: 1

Views: 102

Answers (1)

Likhith Kolayari
Likhith Kolayari

Reputation: 154

--force is a flag which forces a particular operation/process to run So I think to fix the dependencies you would have used npm audit fix --force

You wouldn't have done any damage to your dependency tree.

The npm docs say: npm audit fix Scan your project for vulnerabilities and automatically install any compatible updates to vulnerable dependencies

Please refer https://docs.npmjs.com/cli/audit

Upvotes: 2

Related Questions