asdf-vm / asdf-vm/asdf

bug: No version is set for nodejs; please run `asdf set [options] nodejs <version>`

Open
#2,178 0 comments 2 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
25.6k
Forks
941
Avg merge
9h 24m
Merged PRs (30d)
3

Description

### Describe the Bug

I installed asdf using `sudo port install asdf`.

```zsh
➜ asdf --version
asdf version 0.18.0 (revision unknown)
```

Next, I have the following `.tool-versions` within my `$HOME` directory:

```
erlang 28.0.2
elixir 1.18.4-otp-28
k3d 5.7.5
nodejs system
gleam 1.12.0
```

Furthermore, I installed NodeJS via MacPorts and configured it with asdf:

```zsh
➜ node -v
v22.19.0
asdf set -u nodejs system
➜ asdf current
Name Version Source Installed
elixir 1.18.4-otp-28 /Users/$USER/.tool-versions true
erlang 28.0.2 /Users/$USER/.tool-versions true
gleam 1.12.0 /Users/$USER/.tool-versions true
k3d 5.8.3 /Users/$USER/.tool-versions true
nodejs system /Users/$USER/.tool-versions true
```

Now, when I execute `npm -v` or install any utility, I'm seeing the following message:

```zsh
➜ npm -v
No version is set for nodejs; please run `asdf set [options] nodejs `
11.4.2
```

### Steps to Reproduce

1. Install NodeJS 22 via MacPorts
2. configure nodejs via ASDF
3. check the version of npm or install Node package

### Expected Behaviour

I would expect the following output:

```zsh
➜ npm -v
11.4.2
```

### Actual Behaviour

I'm seeing the following output:

```zsh
➜ npm -v
No version is set for nodejs; please run `asdf set [options] nodejs `
11.4.2
```

### Environment

```shell
➜ asdf info
OS:
Darwin cwt-cerritos.local 25.0.0 Darwin Kernel Version 25.0.0: Wed Aug 27 20:24:11 PDT 2025; root:xnu-12377.1.9~17/RELEASE_ARM64_T6000 arm64 arm Darwin

SHELL:
zsh 5.9 (arm-apple-darwin25.0.0)

BASH VERSION:
5.2.37(1)-release

ASDF VERSION:
0.18.0 (revision unknown)

ASDF INTERNAL VARIABLES:
ASDF_TOOL_VERSIONS_FILENAME=.tool-versions
ASDF_DATA_DIR=/Users/conradwt/.asdf
ASDF_CONFIG_FILE=/Users/conradwt/.asdfrc

ASDF INSTALLED PLUGINS:
elixir https://github.com/asdf-vm/asdf-elixir.git
89098d5c31fd3a240a25b1dacf881a6eeed426c4
erlang https://github.com/asdf-vm/asdf-erlang.git
5f27baa62864bb433be9c7f2f7d69b475f534376
gleam https://github.com/vic/asdf-gleam.git
74337ee4e70a0d8c705c1fed198cf689b4d5bcd4
k3d https://github.com/spencergilbert/asdf-k3d.git
353b949b525a3c0cf0be0e12194f0187a0a08e96
nodejs https://github.com/asdf-vm/asdf-nodejs.git
90b8ecaa556916daba983a7b01869a9ea682f285
```

### asdf plugins affected (if relevant)

At this time, this affects the `nodejs`.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the npm command with the shown .tool-versions entry, using asdf current and asdf info to compare the selected nodejs version with the MacPorts installation. Trace how the nodejs command is resolved in zsh and determine why npm prints the warning before its version. Done means npm -v produces the expected output without the warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs, zsh
Domain
cli
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.