1

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.

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

1 Comment

That was definitely the command I used. Thank you for clearing that up for me.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.