Skip to content

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

@conradwt

Description

@conradwt

Describe the Bug

I installed asdf using sudo port install asdf.

➜ 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:

➜ 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:

➜ npm -v
No version is set for nodejs; please run `asdf set [options] nodejs <version>`
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:

➜ npm -v
11.4.2

Actual Behaviour

I'm seeing the following output:

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

Environment

➜ 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions