Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] After npm upgrade, on Windows getting error that npm.ps1 is not digitally signed #7280

Open
2 tasks done
anonmily opened this issue Mar 11, 2024 · 3 comments
Open
2 tasks done
Labels
Bug thing that needs fixing platform:windows is Windows-specific Priority 2 secondary priority issue

Comments

@anonmily
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

I upgraded npm using npm install -g npm@10.5.0, and then afterwards, I can't use the npm command since I get the code execution error that npm.ps1 is not digitally signed

npm : File C:\Program Files\nodejs\npm.ps1 cannot be loaded. The file C:\Program Files\nodejs\npm.ps1 is not digitally signed. You
cannot run this script on the current system. For more information about running scripts and setting execution policy, see
about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.```

### Expected Behavior

It should be able to be run without having to risk the computer's security by allowing unsigned scripts.

### Steps To Reproduce

1. In Windows 11 with Node v20.11.0, upgrade npm from 10.2.4 `npm install -g npm@10.5.0` in Powershell
2. Try to run any npm command (e.g. `npm install`)
3. Get the error that npm.ps1 is not signed


### Environment

- npm: 10.5.0
- Node.js: 20.11.0
- OS Name: Windows 11 Pro
- System Model Name: ?
- npm config: 
```ini
; node bin location = C:\Program Files\nodejs\node.exe
; node version = v20.11.0
; npm local prefix = C:\Users\anonmily\Projects\myapp
; npm version = 10.5.0
; cwd = C:\Users\anonmily\Projects\myapp
; HOME = C:\Users\anonmily
; Run `npm config ls -l` to show all defaults.
@anonmily anonmily added Bug thing that needs fixing Needs Triage needs review for next steps Release 10.x labels Mar 11, 2024
@milaninfy milaninfy added the platform:windows is Windows-specific label Mar 13, 2024
@dennisrongo
Copy link

@anonmily running this seems to have fixed it for me in Powershell as an admin.
set-ExecutionPolicy RemoteSigned -Scope CurrentUser

@ShuzhaoFeng
Copy link

The issue still persists in 10.5.2. @dennisrongo 's solution works, but I would see it as a temporary workaround.

Do we have any plans on fixing the issue?

@lukekarrys
Copy link
Contributor

This will need to be coordinated with the Node project. I'm going to keep this issue open to avoid duplicates but any fix for this will need to land in The https://github.com/nodejs/node Windows installer.

@lukekarrys lukekarrys added Priority 2 secondary priority issue and removed Release 10.x labels May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing platform:windows is Windows-specific Priority 2 secondary priority issue
Projects
None yet
Development

No branches or pull requests

5 participants