Salam (means Hello) :)
I have the latest version of node.js installed on ubuntu 12.04, I\'m not behind any proxies, and my network settings are correctly configured,
i had same problem. it seems that there is some problem with ISP's https handling. doing:
npm config set registry http://registry.npmjs.org/
worked for me
If you are behind a proxy that has username and password authentication, try setting the proxy as
npm config set proxy http://username:encodedpassword@proxyaddress:port
npm config set https-proxy http://username:encodedpassword@proxyaddress:port
Add the proxy and http_proxy field with your credentials (encoded if it contains any special characters) to your .npmrc file and run npm install again. It should work.
for example:
proxy=http://username:passcode@proxyURL:80/ https_proxy=http://username:passcode@proxyURL:80
I was having the same problem. Found a solution in this thread.
You can see the effective proxy that npm
is using by doing:
npm config get proxy
npm config get https-proxy
If you're behinid a proxy, try this:
mv ~/.npmrc ~/.npmrc.bak
Just follow these steps before you run: npm install -g @angular/cli
npm cache clean
(You can even ignore if it throws an error)npm config set strict-ssl false
npm config set proxy http://myusername:mypassword@proxyaddress:port
npm config set https-proxy http://myusername:mypassword@proxyaddress:port
I was having a similar issue with my windows machine and i fixed it by first checking whether my proxy got some value by executing the below command.
npm config get proxy
in return i got the below:
http://usr:pwd@host/:port
So if anyone who is not under a proxy layer first set the proxy as null by executing the below command.
npm config set proxy null
now if you excecute your npm i it should not throw any network error.