IT 관련

Terminal/Powershell/VScode "Running scripts is disabled on this system" (npm 등 실행시 오류 해결)

Entkommen 2025. 11. 22.
728x90

윈도우 파워쉘 권한설정 문제로 발생

 

  1. 관리자 권한으로 PowerShell을 엽니다. 시작 메뉴를 클릭하고 "PowerShell"을 입력한 다음 "Windows PowerShell"을 마우스 오른쪽 버튼으로 클릭하고 "관리자 권한으로 실행"을 선택합니다 .
  2. 현재 정책 확인: 현재 설정된 정책을 확인하려면 다음 명령을 입력하고 Enter를 누르세요.
    Get-ExecutionPolicy
    
    
     
  3. 정책 변경: 스크립트 실행을 허용하려면 `Set-ExecutionPolicy` 명령을 사용하세요. 예를 들어, 정책을 RemoteSigned 로 설정하려면 다음과 같이 입력하세요.
    Set-ExecutionPolicy RemoteSigned
    
    
     
    확인 메시지가 나타나면 "Y"를 입력 하고 Enter를 누릅니다.
  4. 새로운 정책을 확인하세요. `Get-ExecutionPolicy`를 다시 실행하여 정책이 변경되었는지 확인하세요.
  5. 변경 사항을 적용하려면 PowerShell을 닫았다가 다시 엽니다.

해결됨 PowerShell에서 이 시스템에서 스크립트 실행이 비활성화되었습니다.

참고: 정책을 변경하면 시스템 보안에 영향을 미칠 수 있습니다. 어떤 정책을 선택할지 신중하게 결정하고, 스크립트 실행을 허용하면서도 보안을 강화하려면 RemoteSigned 와 같은 설정을 사용하는 것이 좋습니다.

 


This is a powershell security policy, to fix it, run Powershell as administrator and run the following

coffeescript
PS C:\> Set-ExecutionPolicy RemoteSigned 

If you don't want to run the command as an administrator but just for the current user, you can add a scope like below

 

 

<출처>

1. https://tecadmin.net/powershell-running-scripts-is-disabled-system/

 

Resolved "Running scripts is disabled on this system" PowerShell Error

Running scripts is disabled on this system in Powershell. This error comes when PowerShell execution policy doesn't allow to run scripts

tecadmin.net

2. https://stackoverflow.com/questions/57673913/vsc-powershell-after-npm-updating-packages-ps1-cannot-be-loaded-because-runnin

 

VSC PowerShell. After npm updating packages .ps1 cannot be loaded because running scripts is disabled on this system

I design websites in VSC and PowerShell is my default terminal. After updating and deploying a website to firebase earlier, I was prompted to update firebase tools - which I did using npm. Immedia...

stackoverflow.com

 

728x90