asdf-vm / asdf-vm/asdf-nodejs

npm is shimed but still doens't run the right version

Open
#434 4 comments 3 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
989
Forks
162
PR merge metrics
No merged PRs in 30d

Description

Hello,

I have a situation I have trouble understanding. Node 22.13.0 is ships with npm 10.9.2. However it's not the right npm that asdfs ends up calling.

```
❯ cat .tool-versions
elixir 1.18.2
erlang 27.2.2
nodejs 22.13.0

❯ node -v
v22.13.0

❯ npm -v
11.6.3

❯ ~/.asdf/installs/nodejs/22.13.0/lib/node_modules/npm/bin/npm-cli.js -v
10.9.2

❯ which npm
/home/arch/.asdf/shims/npm

```

Is that a bug? I tried to find similar issues but they all seem a bit different to me. Any way I can troubleshoot more? Several colleagues of mine are also affected.

I think we never noticed it before, but package-lock versions started to differ.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the reported commands with .tool-versions, including node -v, npm -v, which npm, and the direct npm-cli.js path under ~/.asdf/installs/nodejs/22.13.0. Trace why the ~/.asdf/shims/npm command selects npm 11.6.3 instead of the bundled 10.9.2; done means the version selection is explained and corrected so package-lock versions no longer differ unexpectedly.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs, shell
Domain
cli, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.