Skip to content

Node.js and npm commands not recognized in Command Prompt on Windows 11 Home but works fine in PowerShell #5126

@InampudiChowdary

Description

@InampudiChowdary

Node.js Version

v24.12.0 installed lower versions also same issue

NPM Version

'node' is not recognized as an internal or external command

Operating System

Microsoft Windows 11 - [Version 10.0.26200.7462]

Subsystem

console

Description

'node - or npm -v' is not recognized as an internal or external command,
operable program or batch file. using

Steps to Reproduce:

  1. Install Node.js using the .msi installer.
  2. Confirm installation directory: C:\Program Files\nodejs.
  3. Verify PATH includes C:\Program Files\nodejs.
  4. Open PowerShell → run node -v and npm -v → works correctly.
  5. Open Command Prompt (cmd.exe) → run node -v and npm -v.

Expected Behavior:
Both shells should recognize Node.js and npm commands.

Actual Behavior:

  • PowerShell: ✅ Commands work.
  • Command Prompt: ❌ Commands not recognized.

Additional Notes:

  • Restarting the system does not resolve the issue.
  • PATH variable changes are visible in System Environment Variables.
  • Running where node in Command Prompt returns correct result, but works in PowerShell.

Minimal Reproduction

No response

Output

For node -v
'node' is not recognized as an internal or external command,
operable program or batch file.

For npm -v
'npm' is not recognized as an internal or external command,
operable program or batch file.

For where node
C:\Program Files\nodejs\node.exe

For where npm
C:\Program Files\nodejs\npm
C:\Program Files\nodejs\npm.cmd

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

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