天天看點

vs code yarn 無法使用

使用報錯:

yarn : 無法加載檔案 C:\Users\Administrator\AppData\Roaming\npm\yarn.ps1,因為在此系統上禁止運作腳本。有關詳細資訊,請參閱 https:/go.microsoft.com/fwlink/?LinkID=135 
170 中的 about_Execution_Policies。
所在位置 行:1 字元: 1
+ yarn start
+ ~~~~
    + CategoryInfo          : SecurityError: (:) [],PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess      
vs code yarn 無法使用

解決方案

  1. 以管理者權限打開powershell
  2. 執行:set-ExecutionPolicy RemoteSigned
  3. 檢視:get-ExecutionPolicy

繼續閱讀