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

PowerShell execution error on npm.ps1 with Node.js v22.13.1 (digital signature verification failed) #56806

Open
NorthernDream opened this issue Jan 28, 2025 · 1 comment

Comments

@NorthernDream
Copy link

NorthernDream commented Jan 28, 2025

Version

22.13.1

Platform

Microsoft Windows NT 10.0.22621.0 x64

What steps will reproduce the bug?

在 PowerShell 运行 npm -v 会报 error

尝试过22.13.0和20.18.2都不会报错

运行 npm.cmd -v 能正常显示版本

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

必现

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

应正常显示 npm 版本:10.9.2

What do you see instead?

PS C:\> npm -v
npm : 无法加载文件 D:\node\nodejs\npm.ps1。未对文件 D:\node\nodejs\npm.ps1 进行数字签名。无法在当前系统上运行该脚本。有
关运行脚本和设置执行策略的详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies
。
所在位置 行:1 字符: 1
+ npm -v
+ ~~~

Additional information

Environment:

OS: Windows 11

PowerShell Version: 5.1.22621.4391

Possible Causes:

怀疑新版本中 npm.ps1 文件可能:

缺少数字签名

文件哈希值不匹配

权限配置变更

建议检查:

对比 22.13.0 和 22.13.1 的 npm.ps1 文件差异

验证安装包的签名完整性

检查 Windows 系统日志中的相关安全事件

@AugustinMauroy
Copy link
Member

Could you write it in english ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants