vue-cli · Failed to download repo vuejs-templates/webpack-simple: tunneling socket could not be established, statusCode=403 - vue.js

I just started with Vue today and got stuck.
Following is the summary:
npm install -g vue-cli [Result - Successful]
vue init webpack-simple C:\vue [Result - Unsuccessful]
vue init webpack-simple ./ [Result - Unsuccessful]
Throws following error:
vue-cli · Failed to download repo vuejs-templates/webpack-simple: tunneling socket could
not be established, statusCode=403
Then tried the following commands:
npm config set http-profix null
vue init webpack-simple ./
It still throws the error.
Any pointers to this. I am running the script behind proxy wall.
Thanks.

The issue, I suspect is that you're installing from behind a VPN.
You can try disabling it to do the install
on corporate networks that's not always the option
If you don't have the option to disable...
you may be able to use
npm config set registry=http://registry.npmjs.org/
The reason that works is that you're no longer connecting to the default which uses https, where the SSL is failing due the the proxy.
Note that there is an issue of security if you opt to use http instead of https
You may also be able to use a proxy definition in a .npmrc file
If you have your proxy information, you can add it to the .npmrc file in the directory.
https://docs.npmjs.com/misc/config#https-proxy
proxy http://{proxy_server}:{proxy_port}
https-proxy http://{proxy_server}:{proxy_port}
strict-ssl=false
src gist

Related

Cannot login into Verdaccio

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.

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.

manually install npm packages?

I'm experimenting with protractor and following tuturial on github. NPM was already present on my system, I succesfully downloaded protractor and now I'm proceeding with
webdriver-manager update
Which fails with
downloading http://selenium-release.storage.googleapis.com/2.42/selenium-server-standalone-2.42.2.jar...
Error: Got error Error: getaddrinfo ENOTFOUND from http://selenium-release.storage.googleapis.com/2.42/selenium-server-standalone-2.42.2.jar
Updating chromedriver
Error: Got error Error: getaddrinfo ENOTFOUND from https://chromedriver.storage.googleapis.com/2.10/chromedriver_win32.zip
downloading https://chromedriver.storage.googleapis.com/2.10/chromedriver_win32.zip...
Per earlier answered equal questions I double checked my npm proxy settings, all fine for http and https. Also I can see the username:password#proxy definition in .npmrc in my userprofile directory (c:/Users/my-name), the files are also present on the internet. Also the npm install action of protractor worked well. Now is it possible to manually (via browser download the relevant files and have them exploded and installed in the designated places?
I'm on windows 7 SP 1, 32 bit.
Yes you can manually install the webdriver-manager file in "node_modules\protractor\bin".
By the way , the error message really looks like you have a trouble to access internet.
Did you try to set these variables before launching your npm command:
set HTTP_PROXY=http://'your http proxy ip':'your proxy port'
set HTTPS_PROXY=http://'your https proxy ip':'your proxy port'
To answer my own question:
As Yannick mentioned: I only set the proxy configuration with npm config ... For this you also need to set the environment variables
set PROXY=http://<username>:<password>#proxyserver
set HTTP_PROXY=%PROXY%
set HTTPS_PROXY=%PROXY%