Skip to content

npm-prefix.js is not recognized as an internal or external command in Windows 11 #4537

Closed as not planned

Description

@Jaiganesh1607

Node.js Version

v22.13.0

NPM Version

10.9.2

Operating System

Windows 11

Subsystem

Other

Description

Question:
I recently installed Node.js from the official Node.js website. However, when I try to check the version of npm or perform any npm-related operations, I encounter the following error:

CALL "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-prefix.js" is not recognized as an internal or external command, operable program or batch file.

Minimal Reproduction

  1. Installed node.js from official website using windows installer.
  2. Tried to check version of npm.

Output

Image

Before You Submit

  • I have looked for issues that already exist before submitting this
  • My issue follows the guidelines in the README file, and follows the 'How to ask a good question' guide at https://stackoverflow.com/help/how-to-ask

Activity

  1. gadha02 commented on Feb 5, 2025

    @gadha02

    I have the same error. How you resolved this issue?

  2. avivkeller commented on Apr 7, 2025

    @avivkeller
    Member

    Hi! Can you try installing via one of the other installation methods listed on the site? choco, for example? What happens then?

  3. yutian1993 commented on Apr 14, 2025

    @yutian1993

    I got the same error with install node by custom path, when install nodejs, you also get node->lib dir, the node_modules is there, just move the node_modules simply into nodejs bin path can solve the error.

  4. avivkeller commented on Apr 29, 2025

    @avivkeller
    Member

    No response from OP, closing as stale. Assuming the comment above resolved the issue

  5. added and removed
    needs more infoissues that need more info from the author
    on Apr 29, 2025
  6. Jaiganesh1607 commented on May 16, 2025

    @Jaiganesh1607
    Author

    i uninstalled and reinstalled node.js a bunch of times and during one installation it worked out fine.

  7. pushkardeep commented on May 8, 2026

    @pushkardeep

    what about using docker ??

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions