Programming/Deployment, CI, CD

[Vercel] 'npm ERR! code EINTEGRITY...' 에러 해결하기

리버김 2023. 8. 19. 00:49

에러

 

npm ERR! code EINTEGRITY
npm ERR! sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgreytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w== integrity checksum failed when using sha512: wanted sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgreytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w== but got sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==. (4940 bytes)
npm ERR! A complete log of this run can be found in:
npm ERR!     /vercel/.npm/_logs/2023-08-18T13_49_46_579Z-debug-0.log
Error: Command "npm install" exited with 1

Vercel에서 FE 프로젝트 배포를 하다 보면 이런 에러를 마주칠 때가 있다.

npm으로 설치한 패키지의 무결성 검사가 실패했다는 뜻이다.

 

해결 방법

 

아래 command를 배포 configuration 내 'install command' 내에 Override 해준다.

npm cache verify  && npm cache clean --force  && rm -rf package-lock.json &&  npm install

npm cache를 강제 삭제하고, 설치해야 하는 모듈의 정확한 버전이 명시된 package-lock.json을 삭제한 뒤 마지막으로 npm install을 실행해주는 명령어들을 한 번에 넣은 것이다.

 

반응형