問題
Windows 11 の VSCode でターミナルを使って express スクリプトを実行しようとしたところ、次の PowerShell エラーが返ってきました。
cannot be loaded because running scripts is disabled on this system.For more information, seeabout_Execution_Policies at https: /go.microsoft.com/fwlink /? LinkID = 135170.At line: 1 char: 1 + nodemon server + ~~~~~~~ + CategoryInfo : SecurityError: (:)[], PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccessこのリンクは私の環境では開けませんでした。
幸いなことに、簡単な修正方法があります。
解決策
設定 > システム > 開発者向け に移動します。
PowerShell を探し、次のオプションをオンにします。
実行ポリシーの変更 -> オン
あとはスクリプトをもう一度実行すれば、動作するはずです。初回実行時に許可を求められる場合があります。