Can't install anything with npm ECONNRESET without proxy

后端 未结 7 2052
眼角桃花
眼角桃花 2020-12-29 07:31

I used node.js to install some things via npm without any problems. Now I changed nothing on my settings (Win8; no proxy, internet is working) and I can\'t install anything

相关标签:
7条回答
  • 2020-12-29 07:57

    I had the same issue while installing the expo-cli in Windows 8.1, but it resolved after i have followed the below steps.

    run below command in your command prompt.

    npm config edit
    
    

    .npmrc file will open in your default editor.

    Now remove the lines having proxy, https-proxy, registery and save that file.

    After that i was able to install the expo-cli package without the proxy issue.

    0 讨论(0)
  • 2020-12-29 08:03

    Well, actually, I want to give a comment to your question. Because I have low reputation, it means I can't give a.

    If you have a trouble with npm on Windows. I would suggest you take a look the common errors of npm on wiki here. Back to your problem, please make sure you are using internet connection along with proxy or not. If you are using it, please do command npm config set proxy. I found same problem on Stackoverflow and the solution is:

    use

    npm config set registry http://registry.npmjs.org/

    so that npm requests for http url instead of https.

    and then try the same npm install command.

    Don't forget to clear your cache by doing npm cache clean.

    Although, this way can solve the problem. You should consider about the security. This way is not the safe way because it can lead to security problem since https is not used here. I don't recommend to use this on production (thanks @ivarni for pointing this out).

    0 讨论(0)
  • 2020-12-29 08:05

    Had the similar issue on Windows 10 with Node v5.0.0

    Another solution from here that works for me:

    Try to unistall x64 version of Node.js and install x86 one.

    0 讨论(0)
  • 2020-12-29 08:07

    The following worked for me

    1. Instead of using cmd, use the "Node.js commandprompt". To do this, type node in start menu, and on the results, click on "Node.js commandprompt". This will setup the required env variables
    2. In the above shell, run the command

    npm config set registry http://registry.npmjs.org/

    1. Run the command

    npm install -g cordova

    1. Run the command

    npm install -g ionic

    0 讨论(0)
  • 2020-12-29 08:12

    I was got a similar issue.

    I was run below commands

    npm config edit

    Open that file and remove line no approx 8 proxy=http://github.com/ registry=http://registry.npmjs.org/ those are user custom settings remove this file and save it.

    After run below command npm install should be work fine.

    0 讨论(0)
  • 2020-12-29 08:13

    I actually had the same problem, from my workplace I could install everything fine, but it wasn't working from home. I found out that the custom DNS I set up on my routeur was the problem, I have reverted to the default internet provider one and everything works fine.

    0 讨论(0)
提交回复
热议问题