Cannot login into Verdaccio - npm

I have just installed Verdaccio on my computer. I have changed nothing in the config file, apart from adding proxy_related info:
http_proxy: http://proxy.ip:8080
https_proxy: https://proxy.ip:8080
no_proxy: localhost,127.0.0.1
After starting the process, I have tried to login to the registry from the library project workspace
npm adduser --registry http://localhost:4873
But I get this error:
npm ERR! 503 Service Unavailable - POST http://localhost:4873/-/v1/login
If I try to reach http://localhost:4873/ from my browser, I can see the Verdaccio webpage.
What am I doing wrong?

I don't know what kind of environment you are trying this (work, home, etc.) but, for me, my problem was that behind a corporate firewall I have to configure the NPM proxy (http and https), so adding the localhost as an exception to noproxy config attribute of NPM, it worked for me.
npm config set noproxy localhost
Try to change yours, from no_proxy to noproxy, maybe it is simple as that.

Related

Error 403 - Forbidden while trying npm install

So just like every day I do different projects and install additional modules, today I want to install another module and such an error, reinstall the server and still the same .... [Error]The error appeared overnight
I found the issue from here: https://github.com/npm/npm/issues/2119#issuecomment-5321857
It's a very common issue in npm. Actually npm is not working good with HTTPS over a proxy. Changing the registry URL from HTTPS to HTTP will fix the problem.
Try this out:
npm config set registry http://registry.npmjs.org

How to configure npm proxy for the company's Zscaler settings?

0
In my company I can't download the node modules via npm, because the connection is being refused. We use a Zscaler with a .pac config file. I tried to configure the proxy via various tutorials
Is there a way to make npm install (the command) to work behind proxy?
https://www.jhipster.tech/configuring-a-corporate-proxy/
but I don't get it to work. When I type
npm --proxy http://username:password#cacheaddress.com.br:80 install packagename
it tells me "event not found", when I type the password. If I leave the password field empty, I get
npm ERR! 418 I'm a teapot - GET http://registry.npmjs.org/electron - got unknown host (registry.npmjs.org:80)

Yarn install hang but npm works with the same config

When I try to do a yarn install, it hangs. With npm all works fine.
My .npmrc file:
strict-ssl=false
registry=https://[url]/artifacts/repo/npm/
My .yarnrc file:
strict-ssl false
registry "https://[url]/artifacts/repo/npm/"
yarn --verbose output:
verbose 2.703 Performing "GET" request to "[url]/repo/npm/#company/coco.tools-nodejs-lite/-/#company/coco.tools-nodejs-lite-1.0.1.tgz".
[###---] 3/6
I have a private ssl registry and I've seen that when I do a npm install all packages are download from https url, but when I do a yarn install, the packages are download from http. If I delete strict-ssl false in Yarn doesn't work either. If I delete strict-ssl=false in npm I obtain this error:
...tgz failed, reason: unable to verify the first certificate
The registry doesn't work with http request, it only works with https, and when I try to access the registry by browser I obtain a SEC_ERROR_UNKNOWN_ISSUER, but I think that this isn't the problem. The problem is that Yarn's requests are done to http instead https but if I put strict-ssl=true and request are done to https Yarn hangs too...
Can anyone help me?

Errors setting npm proxy config

I tried various npm config but all failed:
registry=http://registry.npmjs.org/
proxy=http://host:8080/
https-proxy=http://host:8080/
strict-ssl=false
This failed with 418 I'm a teapot error.
registry=https://registry.npmjs.org/
proxy=http://host:8080/
https-proxy=http://host:8080/
strict-ssl=false
This just failed to connect.(ECONNRESET)
registry=https://registry.npmjs.org/
proxy=http://host:8080/
https-proxy=https://host:8080/
strict-ssl=false
Finally this failed with:
write EPROTO 140588447455040:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:252:
How should I set config to install packages through proxy server?
npm version : 6.4.1
OS : ubuntu 18.0.4
I ran into the same issue trying to install gulp.
There is something weird about proxy configuration in npm. It appears that old versions of the proxy & https-proxy settings persist somehow, even if they're not in the config. For me, an old proxy setting, with a previous, expired, password was still present, even after I tried deleting via "npm config delete proxy".
What worked for me was to use
npm config edit
then add in valid entries for proxy and https-proxy. e.g.
proxy=http://[username]:[password]#[proxyhost]:8080/
https-proxy=http://[username]:[password]#[proxyhost]:8080/
It seemed that the https-proxy line was the one that got it working.

npm running task rollbackFailedOptional forever

I'm trying to install a new package via npm. Something like this:
npm install -g connection-test
Sadly the console is never finishing the task "rollbackFailedOptional".
I'm behind a proxy which I added to the npm config.
I removed the s from the https of my registry.
Any ideas what could be the issue or how to resolve this?
I made a mistake in the configuration. Didn't put the https:// in front of the Ip-address of the proxy.