You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
npx.ps1 is incompatible with PowerShell ConstrainedLanguage mode #1404
Our Windows environment only allows PowerShell to run in ConstrainedLanguage mode.
The generated npx.ps1 script uses PowerShell features that are blocked in this mode, including:
[Reflection.BindingFlags]
Management.Automation.Language.Parser
Get-Member
Invoke-Expression
The failure occurs when running npx through the PowerShell shim. Node.js and npm are installed correctly, but npx.ps1 fails before the command can run.
Expected behavior:
npx.ps1 should work in PowerShell ConstrainedLanguage mode, or npm should provide a wrapper that does not require restricted PowerShell APIs.
This is an upstream issue with npm, but we may still be able to do something about it.
If you're running NVM for Windows in shim mode, the nvm-windows npx.exe shim calls the npx-cli.js file directly. In link mode, calling npx would hit the Node-provided npx.ps1 or npx.cmd files directly as you've described. Link mode is the "hands off" mode, where the version manager doesn't touch the Node installation.
Note
This is an upstream issue out of our control, but we could modify the Node installer to remove the npx.ps1 file at install time (in link mode). This would force npx ... to run the npx.cmd file. This capability would have to be behind a configuration setting and we'd likely only make this available in certified builds (the paid version designed to support controlled environments).
I'm going to close this since it is an upstream issue that is mitigated via shim mode (.nodejs\npx.exe → npx-cli.js). If there is a desire for the control mentioned in the note, ping us at support@author.io.
If you're running shim mode and still facing this, I'll reopen the issue.
Activity
coreybutler commentedon Sep 18, 2026
This is an upstream issue with npm, but we may still be able to do something about it.
If you're running NVM for Windows in shim mode, the nvm-windows npx.exe shim calls the npx-cli.js file directly. In link mode, calling
npxwould hit the Node-providednpx.ps1ornpx.cmdfiles directly as you've described. Link mode is the "hands off" mode, where the version manager doesn't touch the Node installation.Note
This is an upstream issue out of our control, but we could modify the Node installer to remove the npx.ps1 file at install time (in link mode). This would force
npx ...to run thenpx.cmdfile. This capability would have to be behind a configuration setting and we'd likely only make this available in certified builds (the paid version designed to support controlled environments).I'm going to close this since it is an upstream issue that is mitigated via shim mode (
.nodejs\npx.exe→npx-cli.js). If there is a desire for the control mentioned in the note, ping us at support@author.io.If you're running shim mode and still facing this, I'll reopen the issue.
Run
nvm envto determine your current mode.