npm install issue with proxy - node.js

I have installed NodeJS in my machine and when i try to run the command npm install via the command prompt then the network is blocking to download the node_modules into my machine. So strangely when i use the npm install command, it shows the below message along with some other error messages: npm ERR! network connect ETIMEDOUT 151.101.0.162:443.
So with this issue i have raised to out network team that i am getting this error then they said they will open this IP for my system and strangely what happened next is when they have opened this particular IP address for my system i got the same error with the IP address got changed to npm ERR! network connect ETIMEDOUT 151.101.8.162:443.
So what my question is if the command prompt says like this then how can i develop the Angular 4 app in my machine. Is there any solution to overcome this? Can anybody provide any inputs on this issue.

Related

Running 'npm install' causes a 'npm ERR! code E401'

I'm trying to get a co-worker set up so that she can run 'npm install' I'm able to run it fine on my machine.
When she runs the command, it starts and appears to be running successfully for several minutes - and then dies at the very end with:
npm ERR! code E401
npm ERR! Unable to authenticate, need: BASIC realm="Sonatype Nexus Repository Manager"
I know that she has a recent version of nodejs installed.
I also know that she has access to our nexus repository and should have all the correct permissions. I'm also a little surprised that it appears to be running fine and then dies right at the end. I would think if there was an authentication error she would get it right away.
Any suggestions?
Thanks
Check: https://blog.npmjs.org/post/180599338975/401-scoped-packages
"How to fix the issue First, you can verify your token by running npm
whoami. If it’s invalid or you got the 401 previously mentioned, run
npm login to create a new token and you are good to go." npm

Npm installing module keep timing out

The current problem is that I am unable to install any npm modules as it always time out before installing. I tried using npm cache-clean and npm doctor but all are in green. Checking on the ping is 105. The npm server are all working green so there shouldn't be any error in downloading npm modules.
To get rid of the error,
Start command prompt and enter the code below in command prompt. After restarting the computer, you should be able to download npm.
netsh int ip reset resetlog.txt
When you run the reset command, it rewrites two registry keys that are used by TCP/IP. This has the same result as removing and reinstalling the protocol.

Getting error while installing npm modules on host system via vagrant

I am accessing ubuntu Virtual Machine from my host via vagrant and facing issues in npm module installations.
Scenario 1: When I try to do npm install directly on my ubuntu VM via vagrant I get error like :
npm ERR! ETXTBSY: text file is busy, rename '/home/vagrant/workspace/TruckLease-network/node_modules/bn.js/package.json.1931599852' -> '/home/vagrant/workspace/TruckLease-network/node_modules/bn.js/package.json'
Also gets multiple warnings for various modules giving same error - text file is busy.
I tried adding below to my vagrant file but did not work :
config.vm.provider "virtualbox" do |v| v.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"] end
Scenario 2 : Then I tried to run 'npm install' on windows system directly , it worked with few warnings. Then I did run npm server to launch the application , that also run successfull. But when I hit the application with a get request I get Error :
Original error: Cannot find module '/home/vagrant/workspace/TruckLease-network/node_modules/grpc/src/node/extension_binary/node-v57-linux-x64-glibc/grpc_node.node'
Please suggest where should I exactly run 'npm install' and let me know if there are any pre or post steps for running npm install.
Thanks,
Kalyani
If running npm install on a windows host and then running on Vagrant, you might try npm install --no-bin-links

getaddrinfo EAI_AGAIN registry.npmjs.org:80

Hi guys I'm trying to publish my angular library in npm, but when I login I get this:
npm ERR! code EAI_AGAIN
npm ERR! errno EAI_AGAIN
npm ERR! request to http://registry.npmjs.org/-/user/org.couchdb.user:belzee10 failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org:80
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\belzee\AppData\Roaming\npm-cache\_logs\2018-01-08T16_03_35_050Z-debug.log
versions
node: 8.9.3
npm: 5.5.1
I am behind an authenticated proxy and I have already configured: proxy and https-proxy
npm config set proxy http: // Username: Pa55w0rd # proxyhostname: port
npm config set https-proxy http: // Username: Pa55w0rd # proxyhostname: port
Thank you for your attention
npm config rm proxy
npm config rm https-proxy
Use the above commands and restart the system. It worked for me.
This drove me crazy for hours and I didn't even know what I did to make it work. But the last thing I tried was:
In cmd typed ping registry.npmjs.org.
Error couldn't find the host
Open hosts file through this: https://support.rackspace.com/how-to/modify-your-hosts-file/
Added 151.101.72.162 registry.npmjs.org to a new line.
Save.
Tried installing a package, still didn't work
But I randomly tried to ping registry.npmjs.org again, and it worked!
Tried installing a package again, still didn't work.
Removed the 151.101.72.162 registry.npmjs.org and saved again. Practically reverting the last edit.
Tried installing and it's working now. Why???? I have no idea. For all I know there's a minor deity inside my laptop and I randomly appeased it somehow...
I had this problem in a WSL1 Linux container on a Windows 10 host in a corporate network.
Adding a new nameserver to the top of /etc/resolv.conf as either 9.9.9.9 or 1.1.1.1 fixed the issue.
Try to connect to some other network.
This error resemble some issue with network. I was trying to install a lib from NPM on windows but getting this error. This worked for me. Maybe it might help you too.
The following github link resolved the issue for me ->
https://github.com/StefanScherer/dockerfiles-windows/issues/270#issuecomment-382229052
create the file /etc/docker/daemon.json
and insert:
{
"dns": ["10.0.0.2", "8.8.8.8"]
}
and then restarting pc
First run
npm i npm#latest
and check error is coming again or not. if it is
Try to resolve your proxy settings
For Linux(ubuntu)
https://www.serverlab.ca/tutorials/linux/administration-linux/how-to-configure-proxy-on-ubuntu-18-04/
For windows
https://www.howtogeek.com/tips/how-to-set-your-proxy-settings-in-windows-8.1/
Changed the registry as https://registry.npmjs.org/ in .npmrc file.
In terminal:
npm config rm proxy
npm config rm https-proxy
Restarted the system.
npm i worked :-)
in my case, there must have been network instability, I deactivated then reactivated my internet connection, it works now!
That error means a domain name resolution error in Node.
I'm not sure what exactly could be your issue here, but https://www.codingdefined.com/2015/06/nodejs-error-errno-eaiagain.html has some good info.
This error is definitely due to the proxy you have set up. I had a similar issue earlier, and disabling the proxy worked for me.
I had the same problem you can check if you opening a session that connecting database, you can try disabling any sessions on the database and try again using npm i filepond

Error while installing node inspector on window 7 machine

I ran following command to install node inspector.
npm install -g node-inspector
But npm gave some error. Please see below image for more information. After this I ran node-inspector command which is not recognized by the system.
This looks like npm cannot download tarballs from the public registry.
The error message ENOTFOUND means the npm was not able to resolve the IP address of registry.npmjs.org. Check your network connection and DNS configuration and make sure you can access registry.npmjs.org (e.g. run ping registry.npmjs.org).

Resources