skip to Main Content

I have been trying to install electron for my react app but it kept on giving me this error

npm ERR! code 1
npm ERR! path C:UsersaddisDesktopNigerian-navy-publicationsnigerian-navy-publicationsnode_moduleselectron
npm ERR! command failed
npm ERR! command C:WINDOWSsystem32cmd.exe /d /s /c node install.js
npm ERR! RequestError: read ECONNRESET
npm ERR!     at ClientRequest.<anonymous> (C:UsersaddisDesktopNigerian-navy-publicationsnigerian-navy-publicationsnode_modulesgotdistsourcecoreindex.js:970:111)      
npm ERR!     at Object.onceWrapper (node:events:629:26)
npm ERR!     at ClientRequest.emit (node:events:526:35)
npm ERR!     at origin.emit (C:UsersaddisDesktopNigerian-navy-publicationsnigerian-navy-publicationsnode_modules@szmarczakhttp-timerdistsourceindex.js:43:20)
npm ERR!     at TLSSocket.socketErrorListener (node:_http_client:495:9)
npm ERR!     at TLSSocket.emit (node:events:514:28)
npm ERR!     at emitErrorNT (node:internal/streams/destroy:151:8)
npm ERR!     at emitErrorCloseNT (node:internal/streams/destroy:116:3)
npm ERR!     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
npm ERR!     at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20)

npm ERR! A complete log of this run can be found in: C:UsersaddisAppDataLocalnpm-cache_logs2024-02-15T19_46_59_700Z-debug-0.log

I have tried npm cache clean --force, deleted node-modules & package-lock.json, but nothing worked. I even deleted the log file where it says a complete log of the run can be found but the file kept getting recreated whenever i tried to install again but with the same error. I tried other electron alternatives but the error persisted.

I have tried deleting electron from node-modules, deleted the node-modules folder entirely along side the package-lock.json file in order to run a fresh install, npm cache clean –force, npm cache clean, tried to install other packages to see if the error was just with electron but i kept on recieving the same error.

2

Answers


  1. ECONNRESET is a network error, it appears that something has a post install hook script that is trying to make a connection to a remote machine and the connection is failing.

    You should read the log file to determine which package is being installed at the time and look at the source to see where it is trying to connect to.

    Login or Signup to reply.
  2. I believe this has already been answered here

    According to these answers, you should consider resetting your npm proxy, or changing the registry to force it to use the HTTP protocol (which is not recommended because it could be a security risk).

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search