I am working on a server that has access to the Internet through a proxy. I can't neither access proxy configuration nor change it.
These are the options of .npmrc :
https-proxy = "https://10.1.0.254:8080/"
proxy = "http://10.1.0.254:8080/"
strict-ssl = false
When I try to download a package I get this error prompt :
npm ERR! code EPROTO
npm ERR! syscall write
npm ERR! errno EPROTO
npm ERR! request to https://registry.npmjs.org/bower failed, reason: write EPROTO 139954307135424:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332:
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2023-02-15T15_26_16_616Z-debug-0.log
I have access to https://registry.npmjs.org/ with a web browser through this proxy and the server can resolve the name. I mention that APT works perfectly.
I'm running out of ideas on how to get this working. Any ideas ?
I tried to remove .npmrc configuration and to rely only on system proxy definition. I tried to update npm and also to find other occurence of this problem here.
Don't remove the .npmrc, try to add this:
ssl-protocol=TLSv1.2
Or Alternatively try using a different registry by adding the following line to your .npmrc file::
registry=http://registry.npmjs.org/
Related
Trying to run npm install -g "something". But I'm getting this error.
I'm working on Windows 7:
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npmjs.org/yarn failed, reason:
getaddrinfo ENOTFOUND example.com example.com:8080
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network
settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\User\AppData\Roaming\npm-cache\_logs\2019-03-
01T13_13_42_425Z-debug.log
I see the file content when I open this URL on Chrome https://registry.npmjs.org/yarn
Can anyone help me to resolve this?
After a lot of research finally I found how to solve this issue.
From start I was trying to remove the proxy with npm
npm config rm proxy
npm config rm https-proxy
But for some reason it wasn't successful.
I found the proxy urls in this file
C:\Users\User\.npmrc
https-proxy=http://example.com:8080
proxy=http://example.com:8080/
Removing these manually solved the issue and I was able to install any app with npm.
Mostly (and for me as well) this error is due to incorrect proxy settings. Verify network proxy settings are correct.
Else try removing proxy settings using below commands and try again.
Console
$ npm config rm proxy
$ npm config rm https-proxy
After working with some project, my npm started to download dependencies from wrong address globally:
npm install -g bower
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! network request to http://172.168.1.1/bower failed, reason:
connect ETIMEDOUT 172.168.1.1
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in:
Is there some method to reset download address to default one?
I'm using Windows version of NodeJS
Looks like your registry npm config option points to the wrong location. It must be https://registry.npmjs.org, check it with the following command:
npm config get registry
If your registry is different, use this command to set it correctly:
npm config set registry https://registry.npmjs.org/
I am getting the following error while creating a new Angular project using Angular CLI.
ng new <project-name>
npm WARN registry Unexpected warning for http://registry.npmjs.org/: Miscellaneous Warning ECONNRESET: request to http://registry.npmjs.org/#types%2fjasmine failed, reason: socket hang up
npm WARN registry Using stale package data from http://registry.npmjs.org/ due to a request error during revalidation.
npm ERR! code ECONNRESET
npm ERR! errno ECONNRESET
npm ERR! network request to http://registry.npmjs.org/jsesc failed, reason: socket hang up
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-01-23T15_11_33_289Z-debug.log
Package install failed, see above.
Package install failed, see above.
This could be because I am behind a corporate proxy. So I tried editing npm config file.
I used npm config set proxy http://proxyhostname:proxyport and npm config set https-proxy http://proxyhostname:proxyport.
But still, I was facing the same issue. When I opened the npm config file using npm config edit, I realised that the above commands for proxy settings are just adding two lines at the top of the npm config file but below it still has proxy=null and https-proxy=null. So I tried editing the file manually. Changed proxy=null to proxy=http://proxyhostname:proxyport and https-proxy=null to https-proxy=http://proxyhostname:proxyport. I didn't get any error while saving it but when I opened the file again with npm config edit I see that my manual changes are not present. Is there any step that I am missing to manually change the npm config file? Also, suggest if there is a different solution to the problem (mentioned above) I am facing.
Go to the terminal and write:
npm config edit
Then edit these lines, (adding comments with ";"):
;proxy=http://proxyhostname:proxyport
;https-proxy=http://proxyhostname:proxyport
I think - your default editor is vi, just type :wq and press Enter(As you can see at the screen below), this command will save the file and exit from editor.
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, and were intact since last time when NPM worked fine. But now NPM hangs up installation of any modules with following error:
nasser#nasser-desktop:~/projects/server v3$ npm install simple-proxy
npm WARN package.json docco#0.6.2 No repository field.
npm http GET https://registry.npmjs.org/simple-proxy
npm http GET https://registry.npmjs.org/simple-proxy
npm http GET https://registry.npmjs.org/simple-proxy
npm ERR! network socket hang up
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! System Linux 3.5.0-17-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "simple-proxy"
npm ERR! cwd /home/nasser/projects/serverV3
npm ERR! node -v v0.10.18
npm ERR! npm -v 1.3.8
npm ERR! code ECONNRESET
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/nasser/projects/serverV3/npm-debug.log
npm ERR! not ok code 0
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
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
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.
I tried multiple solution but most of cases happened with me is network/ssl and proxy issue.Network/ssl cases are very common and there are bunch of solution but with proxy thing I shared my fixes with you.
Bash Commands:
npm config set proxy null
npm config set https-proxy null
npm config set http-proxy null
in my case I'm using https://registry.npmjs.org/ url.
After NULL proxy its start working.
npm set default proxy as http://my-proxy.com:1080/ so either we have to change proxy url or null it.
To get your default proxy hit below command in your bash.
npm config get proxy
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
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
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
Find .npmrc file, open with note pad. then delete the proxy setting there
I'm new to Node.js, and I'm going through a few tutorials.
For some reason, I can't install any new node modules.
I am using:
Mac OSX 10.7.4,
Node v. 0.8.6,
NPM v. 1.1.48.
I run npm install X and I always get a
npm ERR! fetch failed https://registry.npmjs.org/-/X
npm ERR! Error: 404 Not Found
When I actually go to the npmjs registry, I can see the project page, but no matter which tarball link I hit, it's always the same:
{
"error": "not_found",
"reason": "document not found"
}
For example, I tried installing fs by running npm install fs and I get:
npm http GET https://registry.npmjs.org/fs
npm http 200 https://registry.npmjs.org/fs
npm http GET https://registry.npmjs.org/-/fs-0.0.0.tgz
npm http 404 https://registry.npmjs.org/-/fs-0.0.0.tgz
npm ERR! fetch failed https://registry.npmjs.org/-/fs-0.0.0.tgz
npm ERR! Error: 404 Not Found
npm ERR! at null.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/fetch.js:47:16)
npm ERR! at EventEmitter.emit (events.js:115:20)
npm ERR! at WriteStream.flush (fs.js:1514:12)
npm ERR! at fs.close (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:92:5)
npm ERR! at Object.oncomplete (fs.js:297:15)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <npm-#googlegroups.com>
npm ERR! System Darwin 11.4.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "fs"
npm ERR! cwd /Users/comocomo/Documents/workspace/nodeTest
npm ERR! node -v v0.8.6
npm ERR! npm -v 1.1.48
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/comocomo/Documents/workspace/nodeTest/npm-debug.log
npm ERR! not ok code 0
I tried fs, fs-extra, express, and formidable, all giving me the same 404 response.
There must be something wrong on my part, I'm pretty sure the whole registry is not broken.
Am I using an old registry? Should I change it in my config file? I honestly would rather not start installing things manually, and I'm sure it's just a small configuration issue.
Thanks!
I found the there is a certificate expired issue with:
npm set registry https://registry.npmjs.org/
So I made it http, not https :-
npm set registry http://registry.npmjs.org/
And have no problems so far.
The repository is not down, it looks like they've changed how they host files (I guess they have restored some old code):
Now you have to add the /package-name/ before the -
Eg:
http://registry.npmjs.org/-/npm-1.1.48.tgz
http://registry.npmjs.org/npm/-/npm-1.1.48.tgz
There are 3 ways to solve it:
Use a complete mirror:
Use a public proxy:
--registry http://165.225.128.50:8000
Host a local proxy:
https://github.com/hughsk/npm-quickfix
git clone https://github.com/hughsk/npm-quickfix.git
cd npm-quickfix
npm set registry http://localhost:8080/
node index.js
I'd personally go with number 3 and revert to npm set registry http://registry.npmjs.org/ as soon as this get resolved.
Stay tuned here for more info: https://github.com/isaacs/npm/issues/2694
Npm repository is currently down.
See issue #2694 on npm github
EDIT:
To use a mirror in the meanwhile:
npm set registry http://ec2-46-137-149-160.eu-west-1.compute.amazonaws.com
you can reset this later with:
npm set registry https://registry.npmjs.org/
source
This error might also occur due to proxy settings, once check that your proxy allow the access to npm commands.
It worked for me quite well.
npm set registry http://85.10.209.91/
(this proxy fetches the original data from registry.npmjs.org and manipulates the tarball urls to fix the tarball file structure issue).
The other solutions seem to have outdated versions.
If you happened to run npm install command on Windows, first make sure you open your command prompt with Administration Privileges. That's what solved the issue for me.
Check under security settings
Allow Apps Downloaded from:
App Store and other identified developers
This was one of the reasons I faced recently.