Documentation error on `Update all the Node.js dependencies to their latest version`
Documentation error on Update all the Node.js dependencies to their latest version
- [ ] Missing/Needed
- [x] Incorrect
- [ ] Confusing
- [ ] Not Sure?
Please Explain in Detail
On https://nodejs.dev/learn/update-all-the-nodejs-dependencies-to-their-latest-version, this line is no longer accurate:
Since npm version 5.0.0,
npm updateupdatespackage.jsonwith newer minor or patch versions. Usenpm update --no-saveto prevent modifyingpackage.json.
When using npm v7+, running npm update does not make changes to package.json. See github.com/npm/cli/issues/708
As of npm v8.3.2, you need to pass the --save flag if you want npm update to edit package.json. See github.com/npm/cli/issues/708#issuecomment-1017980606
Your Proposal for Changes
The documentation should be updated to reflect how things work now. It's not clear to me exactly what changes should be made. These docs do not appear to be versioned (meaning there aren't docs for older versions of node or npm) but surely it would be nice to provide some info to folks who are using older versions of node/npm.
Thanks for the feedback @erikphansen You can see the versioned docs for Node.js here. The learn section of this site is more of a living guide that has changed over time. Can you submit some PR's for the issues you've pointed out?
If this issue still require contributor, I would like to take this 🤸♂️
Yup, we need a contribution here :)
Since npm version 5.0.0, npm update updates package.json with newer minor or patch versions. Use npm update --no-save to prevent modifying package.json.
Is this copy okay?
Use `npm update --save` to update `package.json` with newer minor or patch versions. Use `npm update --no-save` to prevent modifying `package.json`.
Looks good, feel free to PR it!
closed by #2641