Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
npm.ps1 and npx.ps1 execution policy error in Node 24 | GoodFirstPicks

npm.ps1 and npx.ps1 execution policy error in Node 24

nodejs/node 2 comments 6d ago
View on GitHub
mediumopenScope: somewhat clearSkill match: maybeNode.jsJavaScript

Why this is a good first issue

Execution policy errors in Windows PowerShell for npm.ps1 and npx.ps1 scripts.

AI Summary

The issue involves execution policy errors when running npm.ps1 and npx.ps1 scripts in Windows PowerShell. The problem is reproducible and requires a fix to ensure these scripts run without triggering execution policy alarms. The scope is somewhat clear but involves Windows-specific PowerShell behavior.

Issue Description

Version

v24.14.1

Platform

Microsoft Windows NT 10.0.26200.0 x64

Subsystem

bundled npm.ps1 and npx.ps1 scripts

What steps will reproduce the bug?

I usually install node on my Windows machines by downloading the ZIP bundle (LTS) and unpacking it into 'C:\Program Files' and setting the path (NOTE: I have to give admin consensus to add a folder to that directory). The latest version I did not have problems with this approach was Node 20.

In Node 24, I notice that Npm and Npx are now delivered also with .ps1 scripts, contrary to Node 20 where only .cmd scripts were bundled. Invoking these scripts in Windows Powershell doesn't seem to work and ExecutionPolicy errors are returned.

WORKAROUND: in Powershell, don't launch npmand npx, but use explicitly npm.cmd and npx.cmd. This will force to use the old cmd.exe scripts. My understanding is that powershell piping will not work with these but they will launch correctly as individual commands.

How often does it reproduce? Is there a required condition?

100% frequency, reproduced on 2 machines with Windows 11 and latest updates. Both with node-24 zip distribution.

What is the expected behavior? Why is that the expected behavior?

Invoking npmand npx from the Windows's bundled Powershell (version 5.1) cmd line should work.

What do you see instead?

Invoking npmand npx from the Windows Powershell (version 5.1) cmd line seem to trigger the Windows NT "Execution Policy" alarm.

(Unfortunately since my Windows install is in Italian, also Powershell outputs error messages in italian -- apologies).

PS C:\Program Files\node-v24.14.1-win-x64> npm --version
npm : Impossibile caricare il file C:\Program Files\node-v24.14.1-win-x64\npm.ps1. Il file C:\Program
Files\node-v24.14.1-win-x64\npm.ps1 non è firmato digitalmente. Lo script non può essere eseguito nel sistema
corrente. Per ulteriori informazioni sull'esecuzione di script e l'impostazione di criteri d

Want to work on this?

Claim this issue to let others know you're working on it. You'll earn 20 points when you complete it!

Risk Flags

  • Windows-specific
  • execution policy
Loading labels...

Details

Points20 pts
Difficultymedium
Scopesomewhat clear
Skill Matchmaybe
Test Focusedno