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

No update check for global packages #89

Open
jerone opened this issue Jan 16, 2023 · 11 comments
Open

No update check for global packages #89

jerone opened this issue Jan 16, 2023 · 11 comments

Comments

@jerone
Copy link

jerone commented Jan 16, 2023

When opening npm-gui with global packages, the update check doesn't return anything:

image

There should be updates for:

  • @angular/cli 15.0.5 → 15.1.1
  • npm 9.2.0 → 9.3.0

npm-gui version 4.0.1

@q-nick
Copy link
Owner

q-nick commented Jan 22, 2023

Hi @jerone, unfortunately, I can't find any cause for that.

Would you like to share the output of a few additional commands, I need:

npm ls -g --depth=0 --json - will list all your globally installed packages and installed versions

npm outdated -g --json - will show all the latest versions of your global packages - probably this command is somehow broken.

@jerone
Copy link
Author

jerone commented Jan 25, 2023

This is the log from npm-gui:

OK: npm ls -g --depth=0 --json
Command: npm --version, started
Command: npm ls -g --depth=0 --json, started
Command: yarn --version, started
Command: pnpm --version, started
OK: npm ls -g --depth=0 --json
Command: npm outdated -g --json, started
OK: npm outdated -g --json
This is from npm ls -g --depth=0 --json:
{
  "resolved": "file:../Users/<user>/AppData/Roaming/nvm/v18.11.0",
  "dependencies": {
    "@angular/cli": {
      "version": "15.0.5",
      "overridden": false
    },
    "@cspell/dict-nl-nl": {
      "version": "2.2.8",
      "overridden": false
    },
    "corepack": {
      "version": "0.15.3",
      "overridden": false
    },
    "cspell": {
      "version": "6.18.1",
      "overridden": false
    },
    "generator-code": {
      "version": "1.7.2",
      "overridden": false
    },
    "generator-eslint": {
      "version": "4.1.1",
      "overridden": false
    },
    "generator-jest": {
      "version": "1.8.0",
      "overridden": false
    },
    "generator-sublime": {
      "version": "2.0.13",
      "overridden": false
    },
    "js-to-ts-converter": {
      "version": "0.18.2",
      "overridden": false
    },
    "np": {
      "version": "7.6.3",
      "overridden": false
    },
    "npm-check-updates": {
      "version": "16.6.2",
      "overridden": false
    },
    "npm-gui": {
      "version": "4.0.3",
      "overridden": false
    },
    "npm": {
      "version": "9.2.0",
      "overridden": false
    },
    "web-ext": {
      "version": "7.4.0",
      "overridden": false
    },
    "yarn": {
      "version": "1.22.19",
      "overridden": false
    },
    "yo": {
      "version": "4.3.1",
      "overridden": false
    }
  }
}

This is from npm outdated -g --json:

{}

@jerone
Copy link
Author

jerone commented Jan 25, 2023

npm-check-updates however, is correctly detecting outdated packages:

 @angular/cli       15.0.5  →  15.1.2
 cspell             6.18.1  →  6.19.2
 npm                 9.2.0  →   9.3.1
 npm-check-updates  16.6.2  →  16.6.3
 web-ext             7.4.0  →   7.5.0

@jerone
Copy link
Author

jerone commented Jan 29, 2023

There are similar issues reported:

The last issue mentions the use of nvm, which uses symlink for using the right node.js (and unassumingly also global packages). I'm using https://github.com/coreybutler/nvm-windows/

This also corresponds to this old issue: npm/npm#9564

But then again, npm-check-updates does detect updates correctly.

@q-nick
Copy link
Owner

q-nick commented Feb 1, 2023

@jerone I got some idea.

Could you check if you have the newest version under the black button (the one with "=>" mark)?

@q-nick
Copy link
Owner

q-nick commented Feb 1, 2023

obraz

@jerone
Copy link
Author

jerone commented Feb 2, 2023

image

@jerone
Copy link
Author

jerone commented Feb 2, 2023

Weirdly enough, the following command does check for outdated packages and comes back with an huge list of outdated package.
But the list contains the dependencies of dependencies (because that's what --all does):

npm outdated -g --all

Sadly npm outdated -g --all --depth=0 did not change the huge list.

The more I think about this, the more I'm convinced this is an NPM issue.
But I was wondering how your output of npm outdated -g --json looks like...

@q-nick
Copy link
Owner

q-nick commented Feb 2, 2023

Great research @jerone !
I will provide, a unique workaround for global dependencies update - based on versions in package details.

Many thanks!

@q-nick
Copy link
Owner

q-nick commented Feb 15, 2023

@jerone Hi, I released version 4.0.5-beta-1 which should contain a fix for this problem.

Would you like to confirm?

npx npm-gui@4.0.5-beta-1

@jerone
Copy link
Author

jerone commented Feb 15, 2023

Hi @q-nick, I tried it just now, and this is the result:

image

According to ncu I should see two outdated global packages:

PS C:\Users\jerone> ncu -g
[====================] 17/17 100%

 cspell  6.23.0  →  6.26.1
 npm      9.4.2  →   9.5.0
Here is the log from the console when running npx npm-gui@4.0.5-beta-1...
PS C:\Users\jerone> npx npm-gui@4.0.5-beta-1
Need to install the following packages:
  npm-gui@4.0.5-beta-1
Ok to proceed? (y)
listening on: localhost 13377
Command: npm ls -g --depth=0 --json, started
ERROR HANDLER Error: invalid project structure!
    at Object.callback (C:\Users\jerone\AppData\Local\npm-cache\_npx\cb45cb7a4356409f\node_modules\npm-gui\dist\server\index.js:1:10548)
    at K.onIncomingMessage (C:\Users\jerone\AppData\Local\npm-cache\_npx\cb45cb7a4356409f\node_modules\npm-gui\dist\server\index.js:1:9072)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
OK: npm ls -g --depth=0 --json
Command: npm --version, started
Command: npm ls -g --depth=0 --json, started
Command: npm info @angular/cli@15.1.5 --json, started
Command: npm info @cspell/dict-nl-nl@2.2.8 --json, started
Command: npm info @vscode/vsce@2.17.0 --json, started
Command: npm info corepack@0.15.3 --json, started
Command: npm info cspell@6.23.0 --json, started
Command: npm info generator-code@1.7.3 --json, started
Command: npm info generator-eslint@4.1.1 --json, started
Command: npm info generator-jest@1.8.0 --json, started
Command: npm info generator-sublime@2.0.13 --json, started
Command: npm info js-to-ts-converter@0.18.2 --json, started
Command: yarn --version, started
OK: npm info generator-eslint@4.1.1 --json
OK: npm info @angular/cli@15.1.5 --json
OK: npm info corepack@0.15.3 --json
OK: npm info generator-jest@1.8.0 --json
OK: npm info js-to-ts-converter@0.18.2 --json
OK: npm info @cspell/dict-nl-nl@2.2.8 --json
OK: npm info generator-sublime@2.0.13 --json
OK: npm info cspell@6.23.0 --json
OK: npm info generator-code@1.7.3 --json
OK: npm info @vscode/vsce@2.17.0 --json
Command: npm info np@7.6.3 --json, started
Command: npm info npm-check-updates@16.7.4 --json, started
Command: npm info npm-gui@4.0.4 --json, started
Command: npm info npm@9.4.2 --json, started
Command: npm info web-ext@7.5.0 --json, started
Command: npm info yarn@1.22.19 --json, started
Command: npm info yo@4.3.1 --json, started
Command: pnpm --version, started
OK: npm info yo@4.3.1 --json
OK: npm info np@7.6.3 --json
OK: npm info npm-check-updates@16.7.4 --json
OK: npm info web-ext@7.5.0 --json
OK: npm info yarn@1.22.19 --json
OK: npm info npm-gui@4.0.4 --json
OK: npm ls -g --depth=0 --json
Command: npm outdated -g --json, started
OK: npm info npm@9.4.2 --json
OK: npm outdated -g --json

The error at the beginning is correct because I started the tool on an not-project folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants