Skip to content

[BUG] npm outdated -g outputs that it wants to upgrade to a new major version #3612

Description

@Choppel

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

With npm@7 and any other package installed globally that is not up to date (e.g. npm-check-updates@10) the cli call "npm outdated -g" outputs the next major version (npm-check-updates@11) as "wanted". Callign "npm update" updates to that major version.

Expected Behavior

npm@7 should never update to a different major version due to possible breaking changes. This worked in npm@6.

Steps To Reproduce

Test for npm 6

Install npm@6
sudo npm i -g npm@6

Create a test project and install a package locally
mkdir test
cd test
npm init
npm i --save npm-check-updates@10
npm outdated
OK: Column "wanted" for package "npm-check-updates" shows 10..

Install package globally
sudo npm i -g npm-check-updates@10
sudo npm outdated -g
OK: Column "wanted" for package "npm-check-updates" shows 10..

Test for npm 7
Install npm 7
sudo npm i -g npm@7

Create a test project and install a package locally
mkdir test
cd test
npm init
npm i --save npm-check-updates@10
npm outdated
OK: Column "wanted" for package "npm-check-updates" shows 10..

Install package globally
sudo npm i -g npm-check-updates@10
sudo npm outdated -g
ERROR: Column "wanted" for package "npm-check-updates" shows 11..

Environment

  • OS: Linux Mint 20.2 Cinnamon
  • Node: 16.6.0
  • npm: 7.20.3 / 6.14.14

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingRelease 7.xwork is associated with a specific npm 7 releaseconfig:global

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions