next-learn icon indicating copy to clipboard operation
next-learn copied to clipboard

npm run seed error

Open fb12424 opened this issue 2 years ago • 6 comments

> seed
> node -r dotenv/config ./scripts/seed.js

node:events:492
      throw er; // Unhandled 'error' event
      ^

Error: read ECONNRESET
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20)
Emitted 'error' event on WebSocket instance at:
    at emitErrorAndClose (D:\works\2023\nextjs-yfb\nextjs-dashboard\node_modules\ws\lib\websocket.js:1016:13)
    at ClientRequest.<anonymous> (D:\works\2023\nextjs-yfb\nextjs-dashboard\node_modules\ws\lib\websocket.js:864:5)
    at ClientRequest.emit (node:events:514:28)
    at TLSSocket.socketErrorListener (node:_http_client:501:9)
    at TLSSocket.emit (node:events:514:28)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -4077,
  code: 'ECONNRESET',
  syscall: 'read'
}

Node.js v18.17.0

fb12424 avatar Nov 21 '23 07:11 fb12424

@fb12424 thanks for the feedback! Can you provide more information and confirm this issue is still persisting and was not just a network issue?

StephDietz avatar Nov 28 '23 00:11 StephDietz

No it was not a network issue. I have a same issue.

seed node -r dotenv/config ./scripts/seed.js

node:events:492 throw er; // Unhandled 'error' event ^

Error: getaddrinfo ENOENT ep-divine-dew-67834200-pooler.us-east-1.postgres.vercel-storage.com at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:118:26) Emitted 'error' event on WebSocket instance at: at emitErrorAndClose (C:\Users\Arsene\Desktop\Soft Vodooz\ReactJS\nextjs-dashboard\node_modules\ws\lib\websocket.js:1016:13)
at ClientRequest. (C:\Users\Arsene\Desktop\Soft Vodooz\ReactJS\nextjs-dashboard\node_modules\ws\lib\websocket.js:864:5) at ClientRequest.emit (node:events:514:28) at TLSSocket.socketErrorListener (node:_http_client:495:9) at TLSSocket.emit (node:events:514:28) at emitErrorNT (node:internal/streams/destroy:151:8) at emitErrorCloseNT (node:internal/streams/destroy:116:3) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { errno: -4058, code: 'ENOENT', syscall: 'getaddrinfo', hostname: 'ep-divine-dew-67834200-pooler.us-east-1.postgres.vercel-storage.com' }

Node.js v20.9.0

Sedjro09 avatar Nov 29 '23 06:11 Sedjro09

Me too:

yarn run v1.22.19
$ node -r dotenv/config ./scripts/seed.js
node:internal/modules/cjs/loader:1080
  throw err;
  ^

Error: Cannot find module 'dotenv/config'
Require stack:
- internal/preload
    at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
    at Module._load (node:internal/modules/cjs/loader:922:27)
    at internalRequire (node:internal/modules/cjs/loader:174:19)
    at Module._preloadModules (node:internal/modules/cjs/loader:1433:5)
    at loadPreloadModules (node:internal/process/pre_execution:611:5)
    at setupUserModules (node:internal/process/pre_execution:130:3)
    at prepareExecution (node:internal/process/pre_execution:113:5)
    at prepareMainThreadExecution (node:internal/process/pre_execution:40:3)
    at node:internal/main/run_main_module:10:1 {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ 'internal/preload' ]
}

Node.js v18.18.2
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

joelcipriano avatar Dec 04 '23 20:12 joelcipriano

Resolved it here.

I'm following the Learn Next.js examples and, at the same time, prototyping another app.

The error was appearing in this other app and not in the nextjs-dashboard of the exercise.

The problem was the lack of the "dotenv" package.

Just install it and the seed worked perfectly.

Thank you and sorry for the confusion.

joelcipriano avatar Dec 04 '23 20:12 joelcipriano

D:\webstorm\nextjs-dashboard>npm run seed

seed node -r dotenv/config ./scripts/seed.js

node:events:492 throw er; // Unhandled 'error' event ^

Error: read ECONNRESET at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20) Emitted 'error' event on WebSocket instance at: at emitErrorAndClose (D:\webstorm\nextjs-dashboard\node_modules\ws\lib\websocket.js:1016:13) at ClientRequest. (D:\webstorm\nextjs-dashboard\node_modules\ws\lib\websocket.js:864:5) at ClientRequest.emit (node:events:514:28) at TLSSocket.socketErrorListener (node:_http_client:495:9) at TLSSocket.emit (node:events:514:28) at emitErrorNT (node:internal/streams/destroy:151:8) at emitErrorCloseNT (node:internal/streams/destroy:116:3) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { errno: -4077, code: 'ECONNRESET', syscall: 'read' }

Node.js v20.9.0

@joelcipriano I'm encountering an error at the same spot, I've installed "dotenv" package but am still facing errors.

wanglin1329 avatar Dec 28 '23 15:12 wanglin1329

@fb12424 thanks for the feedback! Can you provide more information and confirm this issue is still persisting and was not just a network issue?

It was a network problem in my area. It was fixed after turning on the powershell network agent.

fb12424 avatar Apr 16 '24 08:04 fb12424

I am not able to reproduce this. Please open a new issue if you are still having trouble here. Thank you!

leerob avatar Jun 23 '24 22:06 leerob

@fb12424 thanks for the feedback! Can you provide more information and confirm this issue is still persisting and was not just a network issue?

It was a network problem in my area. It was fixed after turning on the powershell network agent.我所在区域出现了网络问题,通过启用 PowerShell 网络代理后得以解决。

I have set up a proxy but still cannot make the same error. How did you set up the proxy

@fb12424 thanks for the feedback! Can you provide more information and confirm this issue is still persisting and was not just a network issue?

It was a network problem in my area. It was fixed after turning on the powershell network agent.

I have set up a proxy but still cannot make the same error. How did you set up the proxy

blakefan avatar Jul 05 '24 15:07 blakefan