1

Lets imagine i have a npm dependency as this: "webpack": "^5.24.4"

Lets imagine that a new 5.30.0 version is released, so i do a npm update. Webpack is updated, but the package.json stays the same, even whit --save or --save-dev

This is the expected behaviour?

Thanks

3
  • Does this answer your question? npm - Semver versioning - Updating a package with a caret "^" Commented Apr 7, 2021 at 7:24
  • @RobC thas what im thinking, but --save or --save-dev has no effect.Maybe too new npm?? (v7) Commented Apr 7, 2021 at 7:39
  • I force a install of an older version (still beging whit ^5.) and then try the update whit save or --save-dev, but no luck Commented Apr 7, 2021 at 8:18

1 Answer 1

4

Feature to semver update package.json was removed in npm v7 https://github.com/npm/cli/issues/2704

And returned back in v8.3.2 https://docs.npmjs.com/cli/v8/commands/npm-update

To update dependencies in package.json and maintain semantic versions:

npm update --save 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.