nodejs.dev icon indicating copy to clipboard operation
nodejs.dev copied to clipboard

Documentation error on `Update all the Node.js dependencies to their latest version`

Open erikphansen opened this issue 3 years ago • 3 comments

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 update updates package.json with newer minor or patch versions. Use npm update --no-save to prevent modifying package.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.

erikphansen avatar Jun 21 '22 18:06 erikphansen

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?

benhalverson avatar Jun 23 '22 03:06 benhalverson

If this issue still require contributor, I would like to take this 🤸‍♂️

ashiishme avatar Aug 04 '22 20:08 ashiishme

Yup, we need a contribution here :)

ovflowd avatar Aug 05 '22 00:08 ovflowd

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

ashiishme avatar Aug 11 '22 20:08 ashiishme

Looks good, feel free to PR it!

ovflowd avatar Aug 12 '22 09:08 ovflowd

closed by #2641

benhalverson avatar Sep 19 '22 04:09 benhalverson