Skip to content

npm -v does not work on windows 11 / only npm.cmd -v #5105

@alainroger91100

Description

@alainroger91100

Node.js Version

22.20

NPM Version

11.6.2

Operating System

Windows 11

Subsystem

console

Description

in CMD or powershell, I type:

node -v
v22.20

when I type:

npm -v

I get:

npm : File C:\Program Files\nodejs\npm.ps1 cannot be loaded because running scripts is disabled on this system. For
more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ npm -v
+ ~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

To get the npm version I have to type:

npm.cmd -v
v11.6.2

Minimal Reproduction

No response

Output

No response

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