skip to Main Content

At Visual studio code im getting the second part error
and first part i can’t even install anything with npm at terminal.

npm install -g npm@latest
npm ERR! code ECONNREFUSED
npm ERR! errno ECONNREFUSED
npm ERR! FetchError: request to http://registry.npmjs.org/npm failed, reason:
npm ERR!     at ClientRequest.<anonymous> (C:Program Filesnodejsnode_modulesnpmnode_modulesminipass-fetchlibindex.js:130:14)
npm ERR!     at ClientRequest.emit (node:events:514:28)
npm ERR!     at _destroy (node:_http_client:875:13)
npm ERR!     at onSocketNT (node:_http_client:895:5)
npm ERR!     at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
npm ERR!  FetchError: request to http://registry.npmjs.org/npm failed, reason:
npm ERR!     at ClientRequest.<anonymous> (C:Program Filesnodejsnode_modulesnpmnode_modulesminipass-fetchlibindex.js:130:14)
npm ERR!     at ClientRequest.emit (node:events:514:28)
npm ERR!     at _destroy (node:_http_client:875:13)
npm ERR!     at onSocketNT (node:_http_client:895:5)
npm ERR!     at process.processTicksAndRejections (node:internal/process/task_queues:83:21) {
npm ERR!   code: 'ECONNREFUSED',
npm ERR!   errno: 'ECONNREFUSED',
npm ERR!   type: 'system'
npm ERR! }
npm ERR!
npm ERR! If you are behind a proxy, please make sure that the
npm ERR! 'proxy' config is set properly.  See: 'npm help config'
npx create-react-app my-app
npm ERR! code ECONNREFUSED
npm ERR! errno ECONNREFUSED
npm ERR! FetchError: request to http://registry.npmjs.org/create-react-app failed, reason: 
npm ERR!     at ClientRequest.<anonymous> (C:Program Filesnodejsnode_modulesnpmnode_modulesminipass-fetchlibindex.js:130:14)
npm ERR!     at ClientRequest.emit (node:events:514:28)
npm ERR!     at _destroy (node:_http_client:875:13)
npm ERR!     at onSocketNT (node:_http_client:895:5)
npm ERR!     at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
npm ERR!  FetchError: request to http://registry.npmjs.org/create-react-app failed, reason: 
npm ERR!     at ClientRequest.<anonymous> (C:Program Filesnodejsnode_modulesnpmnode_modulesminipass-fetchlibindex.js:130:14)
npm ERR!     at ClientRequest.emit (node:events:514:28)
npm ERR!     at _destroy (node:_http_client:875:13)
npm ERR!     at onSocketNT (node:_http_client:895:5)
npm ERR!     at process.processTicksAndRejections (node:internal/process/task_queues:83:21) {
npm ERR!   code: 'ECONNREFUSED',
npm ERR!   errno: 'ECONNREFUSED',
npm ERR!   type: 'system'
npm ERR! }
npm ERR!
npm ERR! If you are behind a proxy, please make sure that the
npm ERR! 'proxy' config is set properly.  See: 'npm help config'

I tried to change the proxy and that time it gave me an error about proxy, as a default im using localhost:8080

2

Answers


  1. Chosen as BEST ANSWER

    I found this from github and it worked:

    > npm config set proxy null
    > npm config set https-proxy null
    > npm config set registry http://registry.npmjs.org/
    > npm install -g react-native-cli
    

  2. use vite instead

    npm create vite@latest
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search