티스토리 뷰

320x100

`npm run serve:mock` 실행 시 발생

update Error:  Error: read ECONNRESET
    at TLSWrap.onStreamRead (internal/stream_base_commons.js:209:20) {
  errno: 'ECONNRESET',
  code: 'ECONNRESET',
  syscall: 'read'
}
에러 발생: Error: read ECONNRESET
npm ERR! code ELIFECYCLE
npm ERR! errno 253
npm ERR! hr-off-duty@0.1.0 serve:mock: `SERVER_MODE=local vue-cli-service serve --mode mock`
npm ERR! Exit status 253
npm ERR! 
npm ERR! Failed at the hr-off-duty@0.1.0 serve:mock script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/nhn/.npm/_logs/2021-09-08T05_52_33_883Z-debug.log

ECONNRESET, ELIFECYCLE 은 아래 부가적으로 설명되는 에러 로그에 따라 해결 방법이 많이 상이한 듯 하다.

 

간단하게는 컴퓨터 재부팅으로 해결되었다는 경우도 있고,

 

npm cache를 지우고 새로 깔아서 해결되었다는 경우도 있고,

npm cache clean --force
npm rm -rf node_modules/
npm rm package-lock.json
npm install

 

npm resgistry를 http로 변경하여 해결됬다는 경우도 있었다.

https://stackoverflow.com/questions/18419144/npm-not-working-read-econnreset

 

npm not working - "read ECONNRESET"

I'm having a problem with npm, I cant install anything. Here is the error messages: C:\Windows\system32>npm install -g yo npm http GET https://registry.npmjs.org/yo npm http GET https://registry.

stackoverflow.com

 

위의 방법들을 포함해서 여러 시도를 해보았으나 해결되지 않았는데, 이후 npm 버전을 latest로 바꿔서 다시 이것저것 시도해보다가 원래 버전(6.14.13)으로 돌아온 직후 갑자기 해결되었다.

npm install -g npm@latest

 

정확한 원인과 해결방법은 여전히 모르겠다.

320x100
댓글