기타

[PowerShell]이 시스템에서 스크립트를 실행할 수 없으므로 파일을 로드할 수 없습니다.

DevStory 2021. 5. 14.

에러 발생

Visual Studio Code에서 create-react-app 명령어로 React 프로젝트 생성 도중 에러가 발생하였습니다.

PowerShell 실행 정책에서 스크립트 실행을 허용하지 않을 때 발생하므로 실행 정책을 변경합니다.

Create-react-app : 이 시스템에서 스크립트를 실행할 수 없으므로 C:\Program Files\nodejs\create-react-app.ps1 파일을 로드할 수 없습니다. 자세한 내용은 about Execution_Policies(http://go.microsoft.com/fwlink/?LinkID=135170)를 참조하십시오.
위치 줄 : 1 문자 : 1
+ create-react-app hello-react
+ ~~~~~~~
	+ CategoryInfo          : 보안 오류: (:) [], PSSecurityException    
	+ FullyQualifiedErrorId : UnauthorizedAccess

해결방법

1.  Windows PowerShell 프로그램을 우클릭 하여 관리자 권한으로 실행합니다.

2. 실행 정책을 RemoteSigned로 변경 후 실행 정책이 변경이 되었는지 확인합니다.

Set-ExecutionPolicy 명령어로 실행 정책을 변경 후 Get-Executionpolicy 명령어로 변경된 실행 정책이 적용되었는지 확인합니다.

Set-ExecutionPolicy RemoteSigned
Get-ExecutionPolicy

 

반응형

댓글