Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] "npm update" doesn't work #3410

Closed
1 task done
arsinclair opened this issue Jun 13, 2021 · 6 comments
Closed
1 task done

[BUG] "npm update" doesn't work #3410

arsinclair opened this issue Jun 13, 2021 · 6 comments
Labels
pr: needs documentation pull request requires docs before merging Priority 2 secondary priority issue Release 7.x work is associated with a specific npm 7 release

Comments

@arsinclair
Copy link

arsinclair commented Jun 13, 2021

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

$ npm outdated
Package      Current   Wanted  Latest  Location
jest          26.6.3   26.6.3  27.0.4  node_modules/jest
$ npm update
$ npm update jest@latest
$ npm update jest@27.0.4
$ npm outdated
Package      Current   Wanted  Latest  Location
jest          26.6.3   26.6.3  27.0.4  node_modules/jest

As we can see, jest should be upgraded to 27.0.4, but it is not.

Expected Behavior

Per https://docs.npmjs.com/updating-packages-downloaded-from-the-registry

In your project root directory, run the update command:
$ npm update
To test the update, run the outdated command. There should not be any output
$ npm outdated

There should be no output and the package should be upgraded to the latest version.

Environment

  • OS: Windows 10
  • Node: v14.17.0
  • npm: v7.13.0
@arsinclair arsinclair added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Jun 13, 2021
@ljharb
Copy link
Collaborator

ljharb commented Jun 13, 2021

Use npm install, instead of npm update, to update a major version.

@arsinclair
Copy link
Author

Okay, it is thoroughly confusing. But it worked. Should the docs be updated?

@tobiu
Copy link

tobiu commented Jun 15, 2021

I am using v7.16.0 and can confirm that npm update is broken.

The neo.mjs framework was using e.g. "postcss": "^8.3.2", an update did not change it to 8.3.4, which is the latest stable version.

For me the entire npm cli ecosystem is completely messed up for almost 2 months now.

Even npm install does no longer update dependencies.

The only way that still works is:

  1. delete the node_modules folder
  2. delete the package-lock.json
  3. manually update all dependency version numbers inside the package.json
  4. run npm install

This is consuming too much time, especially when deploying new framework versions frequently to the online examples.

Please take a look into it!

@nlf
Copy link
Contributor

nlf commented Jun 20, 2021

The original issue described is indeed intended behavior, though I agree that this could be noted more clearly in the docs to make it less confusing. Today it just says "respecting semver" but we can add an example of what that means.

@tobiu if you can open a new issue and give us as much information as possible to reproduce what's going on for you, we'll take a look!

@nlf nlf added pr: needs documentation pull request requires docs before merging Priority 2 secondary priority issue and removed Needs Triage needs review for next steps Bug thing that needs fixing labels Jun 20, 2021
@wraithgar
Copy link
Member

Docs update PR #3494

@wraithgar
Copy link
Member

Docs updated, will go out with the next release and docs site update will automatically follow that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: needs documentation pull request requires docs before merging Priority 2 secondary priority issue Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests

5 participants