# vs code終端機無法使用指令 > 感謝萬能的gpt給我最簡單的解法,記錄一下 前情提要:這幾天用vs code終端機的時候一直出現下面錯誤 ``` npm : 因為這個系統上已停用指令碼執行,所以無法載入 C:\Program Files\nodejs\npm.ps1 檔案。如需詳細資訊,請參閱 about_Executi on_Policies,網址為 https:/go.microsoft.com/fwlink/?LinkID=135170。 位於 線路:1 字元:1 + npm run dev + ~~~ + CategoryInfo : SecurityError: (:) [], PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess ``` 問了gpt發現是因為PowerShell 政策的關係 ### 解法 1.找到PowerShell,以系統管理員身份執行 2.輸入下列指令並按下Y確認變更 ``` Set-ExecutionPolicy RemoteSigned -Scope CurrentUser ``` 3.變更完之後再輸入原本要下的指令 npm run dev就能正常運作啦!!
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up