我用 Windows 電腦製作 node 程式,在使用 nodemon 時出現以下錯誤。
cannot be loaded because running scripts is disabled on this system
檢查 ExecutionPolicy
首先我們需要先解查 ExecutionPolicy。
打開 command prompt,然後輸入 Start-Process powershell -Verb runAs,也就是以管理員身分使用 PowerShell。
然後在 PowerShell 中輸入 Get-ExecutionPolicy。
如果出現 Restricted,表示不能跑 nodemon。
修正 ExecutionPolicy
在 PowerShell 中輸入 Set-ExecutionPolicy Unrestricted,然後輸入 y 回答是的,即可使用 nodemon。
留言
發佈留言