1

I have installed nodejs and trying to install agular-cli on windows7. Below is the command used to install.

npm install -g angular-cli

When installing angular-cli, its throwing the below error message:

This is most likely not a problem with npm itself and is related to network connectivity.
In most cases you are behind a proxy or have bad network settings.

enter image description here

I tried the below command too, but still facing the same issue.

npm cache clean
npm install -g -f angular-cli

I have gone through many documents and posts to resolve this issue, but unable to resolve. I want to work with IntelliJ and angular2.

I've tried it on multiple machines and get the same error.

--EDITED--

I tried to run the commands as administrator, but still facing the same above mentioned error.I have set the registry using the below command.

>npm set registry https://registry.npmjs.org/
>npm install -g angular-cli

Few things I noticed:

1) Could not able to ping ping 8.8.8.8 - It says Request timed out.

2) Could not able to ping 'ping registry.npmjs.org' - It says Request timed out.

3) I can connect via https in browser, https://registry.npmjs.org/

Do I need to set proxy settings to solve this issue, if so how to set? Any suggestions would be helpful.

javaUser
  • 21
  • 1
  • 11
  • Have you tried running your command prompt as administrator? – Joe Clay Nov 09 '16 at 15:45
  • Yes, I tried running command prompt as administrator, but still facing the same issue mentioned above. Any suggestions, thanks. @JoeClay – javaUser Nov 09 '16 at 16:24
  • Are you behind proxy? What is content of .npmrc in user home directory? Please also follow the steps from http://stackoverflow.com/a/39593148/2708895 – Krzysztof Safjanowski Nov 09 '16 at 16:43
  • Possible duplicate of [Error : getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443](http://stackoverflow.com/questions/39592908/error-getaddrinfo-enotfound-registry-npmjs-org-registry-npmjs-org443) – Krzysztof Safjanowski Nov 09 '16 at 16:47

1 Answers1

0

According to the error messages you've got two issues.

The first, you're not running as administrator, which is why it's showing an EPERM error and it can't write to C:\program files\nodejs\npm-debug.log.

To run as administrator, right click the cmd.exe icon and choose run as administrator from the menu. It should says "Administrator" in the titlebar of the cmd window.

The second issue is a timeout, denoted by the ETIMEOUT. This means that it's taking too long for NPM to connect to the servers. This means you either tried this during one of the rare times the NPM servers went down, or you're behind a proxy.

If you're behind a proxy, you need to either reconfigure your router or configure NPM to work through proxies.

Further discussion about this issue on github: https://github.com/npm/npm/issues/8293

Many people seem to be reporting that their network is set to private or that their router's firewall doesn't allow npm through. Others are reporting that setting the npm registry explicitly helped:

npm config set registry http://registry.npmjs.org
Soviut
  • 88,194
  • 49
  • 192
  • 260
  • I tried to run as administrator and I have set "npm config set registry http://registry.npmjs.org" as you suggested, but still facing the same issue. From where can I find the proxy details, do I need to change in my machine? Thanks in advance. – javaUser Nov 09 '16 at 17:40
  • Try disabling your router's firewall. If you're in a corporate environment you'll probably have to talk to your IT department to sort this out instead. – Soviut Nov 09 '16 at 17:41