반응형
요약
- windows 환경에서 npm install시에
발생하는 이슈입니다.
Error
npm ERR! ... `node-gyp rebuild`
Solution
- node -v 확인
- npm -v 확인
// node-gyp 설치
npm install --global node-gyp
// case1 (설치가 정상적으로 되는 경우)
// windows-build-tools는 python도 같이 설치된다
npm install --global --production windows-build-tools
// case2 (windows-build-tools가 설치가 멈춘 경우 -> 패키지 매니저 choco 활용)
// choco 설치(cmd 관리자)
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command " [System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
// choco 설치(powershell 관리자)
Get-ExecutionPolicy
Set-ExecutionPolicy AllSigned
Set-ExecutionPolicy Bypass -Scope Process
$ Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
// python visualcpp-build-tools 설치
choco install python visualcpp-build-tools
npm config set msvs_version 2017
반응형
'개발' 카테고리의 다른 글
Android-No signature of method: build_ (0) | 2022.06.30 |
---|---|
IOS-유효한 ‘aps-environment’ 인타이틀먼트 문자열을 찾을 수 없습니다. (0) | 2022.06.30 |
nodeJS-mysql2/promise 연결 끊기는 문제 (0) | 2022.06.17 |
nodeJS-TypeError: source.on is not a function (0) | 2022.06.15 |
visual studio code-terminal에서 code 명령어 안되는 문제 (0) | 2022.06.13 |
댓글