NPM Repository to the official registry.npmjs.org : "java.net.ConnectException: Connection refused"

384 views
Skip to first unread message

electrotype

unread,
Oct 30, 2015, 1:13:05 PM10/30/15
to Nexus Users

Hi,

I configured a private and hosted npm repository and it worked well! I'm able to publish to it and to get the files. So I guess my "npmrc" file (on Windows) if correctly configured for authentication :

It's something like :
----------------------------
prefix=${APPDATA}\npm
registry=http://XXXXX:8081/nexus/content/repositories/npm-private

always-auth=true
init.author.name=John Doe
init.author.email=exa...@example.com
email=exa...@example.com
_auth=dWyhbWE4bTrvaHcheWR0MTl3R0o=

----------------------------

But I also try to configure a proxy repository pointing to the official "registry.npmjs.org". In the end, I want to group those two repositories together in a group repository but, for now, I try to use the proxy repository directly and it doesn't work. My test "npmrc" now contains :

registry=http://XXXXX:8081/nexus/content/repositories/npm-officiel


And here's my config for this repo :

http://i.imgur.com/Pgk7Y19.png

My user has all the permissions in Nexus.

When I try to do "npm install express --save" I get an error and this log appears in Nexus :

--------------------
org.sonatype.nexus.content.internal.ContentServlet - org.sonatype.nexus.proxy.LocalStorageException: Metadata service error, caused by: org.apache.http.conn.HttpHostConnectException: Connect to registry.npmjs.org:443 [registry.npmjs.org/23.235.46.162] failed: Connection refused: connect, caused by: java.net.ConnectException: Connection refused: connect [client=10.12.37.5,ua=npm/2.14.7 node/v4.2.1 win32 x64,req=GET http://scorpowdrmd1:8081/nexus/content/repositories/npm-officiel/express]
--------------------

Does this mean "registry.npmjs.org:443" is blocked by our firewall (this is possible, but I did ask the sysadmins to open port 443 for "registry.npmjs.org" and they told me it was done), or does it mean Nexus refused the connection?

Thanks!




Rich Seddon

unread,
Oct 30, 2015, 2:03:30 PM10/30/15
to electrotype, Nexus Users
That message means that the connection was refused by the server Nexus is trying to connect to.

So it would seem that your firewall isn't allowing access, since https://registry.npmjs.org/ is up and running currently.

One thing to check for.. if you need to go through an http proxy repository to reach the internet be sure it is configured in the Nexus UI under administration/server.

Rich


--
You received this message because you are subscribed to the Google Groups "Nexus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nexus-users...@glists.sonatype.com.
To post to this group, send email to nexus...@glists.sonatype.com.
To view this discussion on the web visit https://groups.google.com/a/glists.sonatype.com/d/msgid/nexus-users/e8fd75aa-ab72-4bd6-b5b5-7cd87c120a32%40glists.sonatype.com.
For more options, visit https://groups.google.com/a/glists.sonatype.com/d/optout.

electrotype

unread,
Oct 30, 2015, 2:13:25 PM10/30/15
to Nexus Users, elect...@gmail.com
Thank you Rich.


Reply all
Reply to author
Forward
0 new messages