Getting error using npm install from repository cloned from bitbucket? - npm

getting error - request to https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz failed, reason: getaddrinfo ENOTFOUND (proxy server)?
I have set up my proxy variable correctly also set up the global config as well. when i do npm config list it also displays the proxy set up by me. This is how my npm config file looks like

Related

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"

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.

create-react-app-typescript failed with Proxy Authentication required error while creating app

I am working in corporate premise. I am trying to create react app with typescript but it failed with below error:
D:\learning\reactjs>create-react-app my-app --scripts-version=react-scripts-ts
Creating a new React app in D:\learning\reactjs\my-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripemphasized textts-ts...
npm ERR! code E407
npm ERR! 407 Proxy Authentication Required: react-scripts-ts#latest
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\kalpanap\AppData\Roaming\npm-cache_logs\2018-02-21T02_33_17_410Z-debug.log
Aborting installation.
*npm install --save --save-exact --loglevel error react react-dom react-**scripts-ts has failed.*
Deleting generated file... package.json
Deleting my-app / from D:\learning\reactjs
Can anyone help to fix this problem?
Even I have updated npm config proxy and https-proxy to office n/w proxy. After this change only I was able to successfully run the npm install command.
How can I create-react-app with passing proxy parameters?
Thanks in advance
Your company's proxy must be not allowing you to access the setup.
Use the following two commands from command-promt
npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080
In place of "proxy.company.com", use your proxy address that you are using.
You can find your proxy at
IE Browser -> Internet Options -> Connections tab -> LAN Settings.

Can't run bower or npm through network firewall even with proxy set - ETIMEOUT

I can't get bower or npm to work though a client's network and I'm not sure if I'm setting up the proxy settings correctly.
I've tried the various suggestions on answers to similar questions and simply nothing works for me. I get the following error:
C:\myproj>bower search react
bower retry Request to http://bower.herokuapp.com/packages/search/react
failed with ETIMEDOUT, retrying in 1.7s
bower retry Request to http://bower.herokuapp.com/packages/search/react
failed with ETIMEDOUT, retrying in 3.6s
bower retry Request to http://bower.herokuapp.com/packages/search/react
failed with ETIMEDOUT, retrying in 7.0s
bower retry Request to http://bower.herokuapp.com/packages/search/react
failed with ETIMEDOUT, retrying in 14.6s
I can access http://bower.herokuapp.com fine though the browser and it serves me the json reply.
my .bowerrc file (used '\\' on the domain\user name as it failed to parse it otherwise):
{
"directory": "Content/bower_components",
"proxy": "http://mydomain\\myuser:mypassword#nnnnn004.claims.local:8080",
"https-proxy": "http://mydomain\\myuser:mypassword#nnnnn004.claims.local:8080",
"strict-ssl": false,
"registry": "http://bower.herokuapp.com"
}
for NPM it just hangs:
C:\myproj>npm install grunt-cli
npm WARN package.json cl.clientappointment#1.0.0 No repository field.
npm WARN package.json cl.clientappointment#1.0.0 No README data
|
my .gitconfig file:
[url "http://"]
insteadOf = git://
[http]
proxy = http://mydomain\\myuser:mypassword#nnnnn004.claims.local:8080
[https]
proxy = http://mydomain\\myuser:mypassword#nnnnn004.claims.local:8080
my .npmrc file:
proxy=http://mydomain\\myuser:mypassword#nnnnn004.claims.local:8080/
https-proxy=http://mydomain\\myuser:mypassword#nnnnn004.claims.local:8080/
strict-ssl=false
All works fine if I connect to a different network without firewall.
I'm not sure if I've entered my user name/ password correctly on the proxy string supplied, or if I'm just missing a setting somewhere else.
So the problem was that I didn't escape special characters in my proxy url used by NPM (.npmrc) and Bower (.bowerrc).
i.e.
proxy=http://domain\user:password#proxy:8080"
needed to be
proxy=http://domain%5Cuser:password#proxy:8080"

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%