执行yo命令 报错:shell
yo : 没法加载文件 C:\Users\aaa\AppData\Roaming\npm\yo.ps1,由于在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go .microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。 所在位置 行:1 字符: 1 + yo tinymce + ~~ + CategoryInfo : SecurityError: (:) [],PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess
如图npm
打开微软的官方文档
https://docs.microsoft.com/zh...spa
使用命令code
Get-ExecutionPolicy -List
检查powershell设置,看结果是不是:blog
Scope ExecutionPolicy ----- --------------- MachinePolicy Undefined UserPolicy Undefined Process Undefined CurrentUser RemoteSigned LocalMachine AllSigned
CurrentUser 若是不是 RemoteSigned 就使用命令(管理员模式)ci
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
设置CurrentUser为RemoteSigned 就能够了。文档