asdf-vm / asdf-vm/asdf-nodejs

NPM fails to run with ASDF v0.17.0 – "Cannot find module 'npm-prefix.js'"

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

Description

After upgrading ASDF to version 0.17.0 using Brew, npm stopped working entirely — even though node is correctly installed and recognized. This issue did not occur before the upgrade, and everything works fine when switching to nvm.

The error I get when trying to run npm is:

```bash

node:internal/modules/cjs/loader:1408
throw err;
^

Error: Cannot find module '/Users/phrosa/.asdf/installs/nodejs/24.1.0/bin/node_modules/npm/bin/npm-prefix.js'
...
Node.js v24.1.0
Could not determine Node.js install directory
```
I have already tried:
• asdf reshim
• Reinstalling the Node.js plugin
• Switching Node.js versions

Paths differ, and npm cannot find its core files (npm-prefix.js). When I use nvm, everything works perfectly.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.