2026年6月22日 星期一

筆記 VS Code npm run 無法載入npm.ps1 檔

出現類似下列錯誤
npm : 因為這個系統上已停用指令碼執行,所以無法載入 C:\Program Files\nodejs\npm.ps1 檔案。如需詳細資訊,請參閱 about_Execution_Policies,網 址為 https:/go.microsoft.com/fwlink/?LinkID=135170。 位於 線路:1 字元:1 + npm run build + ~~~ + CategoryInfo : SecurityError: (:) [], PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess
管理員系統身分執行PowerShell輸入下列
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
參考來源
AI