0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

npm installでFetchErrorやらECONNRESETと出た

0
Posted at

npm installが失敗する

大したことではなかったのですが、タイムアウトを設定して上手くいきました。

バージョンは以下

➜  ✗ node -v
v20.19.1
➜  ✗ npm -v
11.2.0

作業ログ

➜  app git:(develop) npm install
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated google-p12-pem@4.0.1: Package is no longer maintained
npm warn deprecated uglify-es@3.3.9: support for ECMAScript is superseded by `uglify-js` as of v3.13.0
npm error code 1
npm error path /Users/user/src/app/node_modules/supabase
npm error command failed
npm error command sh -c node scripts/postinstall.js
npm error Downloading https://github.com/supabase/cli/releases/download/v1.136.2/supabase_darwin_arm64.tar.gz
npm error Downloading https://github.com/supabase/cli/releases/download/v1.136.2/supabase_1.136.2_checksums.txt
npm error file:///Users/user/src/app/node_modules/supabase/node_modules/node-fetch/src/index.js:108
npm error                       reject(new FetchError(`request to ${request.url} failed, reason: ${error.message}`, 'system', error));
npm error                              ^
npm error
npm error FetchError: request to https://github.com/supabase/cli/releases/download/v1.136.2/supabase_1.136.2_checksums.txt failed, reason: socket hang up
npm error     at ClientRequest.<anonymous> (file:///Users/user/src/app/node_modules/supabase/node_modules/node-fetch/src/index.js:108:11)
npm error     at ClientRequest.emit (node:events:518:28)
npm error     at emitErrorEvent (node:_http_client:101:11)
npm error     at TLSSocket.socketOnEnd (node:_http_client:528:5)
npm error     at TLSSocket.emit (node:events:530:35)
npm error     at endReadableNT (node:internal/streams/readable:1698:12)
npm error     at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
npm error   type: 'system',
npm error   errno: 'ECONNRESET',
npm error   code: 'ECONNRESET',
npm error   erroredSysCall: undefined
npm error }
npm error
npm error Node.js v20.18.1
npm error A complete log of this run can be found in: /Users/user/.npm/_logs/2025-11-30T14_10_16_785Z-debug-0.log

node_moduleやpackage-lock.jsonを消してみるが、上手くいかない

➜ rm -rf node_modules package-lock.json

エラー文を読んでみると、FetchErrorやらECONNRESETと出ているので通信周りっぽい

npm error FetchError: request to https://github.com/supabase/cli/releases/download/v1.136.2/supabase_1.136.2_checksums.txt failed, reason: socket hang up
{中略}
npm error   errno: 'ECONNRESET',
npm error   code: 'ECONNRESET',

時間を指定して再実行したら成功した。

npm install --fetch-timeout=120000
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?