執行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 就能夠了。文檔