How to install files using npm behind proxy? - npm

While running the npm install command, I'm getting:
ERR 418 I m a teapot
I set a proxy but I'm not sure whether it is correctly parsed. I doubt that the proxy might be the reason. Can someone help me on this? I also ran npm config get proxy.

Try something like this:
npm config set proxy 213.169.158.34:8080
npm config set https-proxy 213.169.158.34:443
npm config set registry http://registry.npmjs.org/
npm instal

Related

List of npm registry

I want list of npm registries. I cannot install npm packages from https://registry.npmjs.org/, registry http://r.cnpmjs.org, http://registry.npmjs.eu, https://registry.npm.taobao.org/. They are all blocked. If you have any idea please make me aware of how can i install packages
Why its blocked?
maybe the right solution will be to use proxy like that (use your proxy its just an example)
npm config set proxy http://proxy.com:8000
or
npm config set https-proxy http://proxy.com:8000

npm install failing with proxy authentication required despite noproxy being set

I have an issue with npm install. I have configured npm to use my company's registry and configured the proxy to get external dependencies and set noproxy for my company's intranet.
noproxy = "*.intra.company.fr"
proxy = "http://user:pass#proxy.intra.company.fr:8080/"
registry = "http://registry.subdomain.intra.company.fr/repository/npm/"
However, when I try to install my project, I get this error:
npm ERR! code E407
npm ERR! 407 Proxy Authentication Required - GET http://registry.subdomain.intra.company.fr/repository/npm/#babel/types/-/types-7.15.0.tgz
I checked, I have no system environment variables set for HTTP_PROXY, PROXY or NO_PROXY.
Edit: npm version is 6.14.15
What's your NPM version ? you should be able to set noproxy on a domain wih NPM 6.4.1+ with a custom registry configured.
npm config set noproxy "*.intra.company.fr"
But maybe there is an issue with *, can you try to set your noproxy with your private registry ?
noproxy = "registry.subdomain.intra.company.fr"
You could also try to manually change your config in .npmrc.
By default, the value of noproxy is taken from the no_proxy environment variable. Try to use it to fix your issue.
export no_proxy="intra.company.fr"

Configure npm install proxy

I want to configure node so that I can download packages using npm install knowing that I am inside a company with a proxy.
I tried commands like :
npm config set https-proxy "http://company%5Cuser:password#server:port/"
but nothing changes.
Did I miss something?
Try to also set the http proxy:
npm config set proxy "http://company%5Cuser:password#server:port/"
Using CNTLM proxy had spared me those configs.

npm ERR! 405 Method Not Allowed: express#latest

Of the several 405 related Questions posted here, none apply to my issue.
Here is the command I issued from Windows 7 on my Desktop PC:
npm install express
Here is the Error message:
npm ERR! code E405
npm ERR! 405 Method Not Allowed: express#latest
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\mr9832\AppData\Roaming\npm-cache\_logs\2018-02-21T20_36_09_581Z-debug.log
Here is the verbose Error Log mentioned above
C:\Users\mr9832\AppData\Roaming\npm-cache_logs\2018-02-21T20_36_09_581Z-debug.log
How can I fix it?
This answer is probably a little bit too late, but I had the same problem. I fixed it by putting following settings in the npm config (located in %USERDATA%/.npmrc):
strict-ssl=false
registry=http://registry.npmjs.org
It requests the packages over plain http instead of the secure https.
Use these commands:
npm config set proxy http://username:password#host:port
npm config set https-proxy http://username:password#host:port
Or you may edit the ~/.npmrc file:
proxy=http://username:password#host:port
https-proxy=http://username:password#host:port
https_proxy=http://username:password#host:port
I had the same problem, turns out the proxy and/or https-proxy config pointed to the wrong proxy server.
The following commands set the proxy to the correct address:
npm config set https-proxy http://127.0.0.1:3128
npm config set proxy http://127.0.0.1:3128

npm try to use proxy after have removed it

I have set proxy for my npm, and now when I removed it
npm config rm http-proxy
I can't install packages.
npm try to use the proxy
Check your .npmrc file to see what's in there?