Skip to content

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

Description

@pedrorcruzz

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:

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions