vscode - AppData\Roaming\npm\yarn.ps1 로드할 수 없습니다
AppData\Roaming\npm\yarn.ps1 로드할 수 없습니다
문제
- vscode의 터미널에서 yarn으로 패키지 설치하려니 아래와 같은 에러 발생
yarn : 이 시스템에서 스크립트를 실행할 수 없으므로 C:\Users\<USERNAME>\AppData\Roaming\npm\yarn.ps1 파일을 로드할 수 없습니다. 자세한 내용은 about_Execution_Policies(https://go.microsoft.com/fwlink/?LinkID=135170)를 참조하십시
오.
위치 줄:1 문자:1
+ yarn
+ ~~~~
+ CategoryInfo : 보안 오류: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
원인
해결
"terminal.integrated.shellArgs.windows": ["-ExecutionPolicy", "Bypass"]
를 사용하려니 deprecated 됐다고 나온다- 문서에 따르면 아래와 shell.windows, shellArgs.windows가 아닌
profiles
를 미리 설정하고 어떤 프로필을 사용할 것인지 설정하는 방식으로 사용할 것을 권장하고 있다 - 물론 -ExecutionPolicy는 마찬가지로
Bypass
로 설정해야 한다
"terminal.integrated.profiles.windows": {
"PowerShell_default": {
"source": "PowerShell",
"args": ["-ExecutionPolicy", "Bypass"]
}
},
"terminal.integrated.defaultProfile.windows": "PowerShell_default",