Error while installing node inspector on window 7 machine - node.js

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).

Related

npm command in VM

I have successfully installed the version of nodejs 14.18 in both in my host machine and VM. After some troubleshooting I manage to make javascripting work in my host machine however when I type javascripting in VM, it says command not found.
ERROR Message
anyone know why this message is displayed any help would be appreciated
I use vagrant as VM and it is required.
npm install -g javascripting attempts to install the module globally, which requires sudo elevation.
If you just want to install the module locally, run npm install javascripting without the -g parameter

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.

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

npm install issue with proxy

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.

npm install hangs

This is my package.json:
{
"name": "my-example-app",
"version": "0.1.0",
"dependencies": {
"request": "*",
"nano": "3.3.x",
"async": "~0.2"
}
}
Now, when I open the cmd and run npm install, the install hangs. What am I doing wrong?
I had the same problem. The reason - wrong proxy was configured and because of that npm was unable to download packages.
So your best bet is to the see the output of
$ npm install --verbose
and identify the problem. If you have never configured proxy, then possible causes can be
Very outdated npm version.
Some problem with your internet connection.
Permissions are not sufficient for npm to modify files.
I was having the same problem. I tried a
npm config set registry http://registry.npmjs.org/
to turn off https. I also tried
npm set progress=false
to turn off the progress bar (it has been reported to slow down downloads).
The problem was with my network driver. I just needed to reboot and the lag went away.
You can try deleting package-lock.json and running npm install afterwards.
This worked for me.
I had the same issue on macOS, after some time struggling and searching around, this answer actually solved the issue for me:
npm config rm proxy
npm config rm https-proxy
npm config set registry http://registry.npmjs.org/
On MacOS, I was able to solve this by
networksetup -setv6off Wi-Fi
After installing, you can revert to the original configuration with
networksetup -setv6automatic Wi-Fi
Updating npm helped me on Mac OS. Use the command:
sudo npm install -g npm#latest
I am behind a corporate proxy, so I usually use an intermediate proxy to enable NTLM authentication.
I had hangs problem with npm install when using CNTLM proxy. With NTLM-APS (a similar proxy) the hangs were gone.
npm cache clear --force has fixed this issue for me in the past.
Furthermore, when running npm install on an air-gapped network (by the way, I provide a description about how to do this with Verdaccio), I had an issue where the install would hang at the very end. Turning off auditing (i.e. npm set audit false) on the machine on the air-gapped network resolved this issue.
While your mileage may vary, running npm cache verify fixed the issue for me.
It was strange but I guess I was just being impatient ran -> npm install --verbose and saw there was progress but it was just really slow!!! All I needed was patience :D
When your ssh key is password protected run ssh-add. npm probably hangs somewhere asking for your password.
Remove node_modules & package-lock.json from previous npm install and install again
rm -rf node_modules package-lock.json
npm install
or
If npm install loader is stuck and then pops up with..
npm ERR! code UNABLE_TO_GET_ISSUER_CERT_LOCALLY
npm ERR! errno UNABLE_TO_GET_ISSUER_CERT_LOCALLY
npm ERR! request to https://registry.npmjs.org/jest failed, reason: unable to get local issuer certificate"
then,
npm config set strict-ssl false
npm install
or
Follow to uninstall Node.js and install properly
https://www.geeksforgeeks.org/how-to-completely-remove-node-js-from-windows/
https://coding-boot-camp.github.io/full-stack/nodejs/how-to-install-nodejs
I personally had this issue and did all the steps I listed above. My issue was fixed with npm config set strict-ssl false
The registry(https://registry.npmjs.org/cordova) was blocked by our firewall. Unblocking it fixed the issue.
With due respect to all the answers, I switched to a different network and it worked for me.
Surprisingly just restarting my computer and running npm install again worked for me
Incase its useful to others, the following is what worked for me:
On my machine, although npm proxy was set correctly, npm install waits forever doing something like sill extract. Re-trying npm install waits forever on the same package again and again.
After waiting for a long timeout, npm install printed an error message implying that git was trying to fetch something.
The problem vanished after configuring git proxy using the below command:
git config --global http.proxy https://proxy-server:port
Note the https in the value of http.proxy without which the configuration did not take effect. Proxy server settings (http / https / port) might vary for users; hence its worth spending a bit of time experimenting with npm and git proxy server settings.
This method is working for me when npm blocks in installation Package for IONIC installation and ReactNative and another package npm.
You can change temporary:
npm config set prefix C:\Users\[username]\AppData\Roaming\npm\node_modules2
Change the path in environment variables. Set:
C:\Users[username]\AppData\Roaming\npm\node_modules2
Run the command to install your package.
Open file explorer, copy the link:
C:\Users[username]\AppData\Roaming\npm\node_modules
ok file yourpackage.CMD created another folder Created "node_modules2" in node_modules and contain your package folder.
Copy your package file CMD to parent folder "npm".
Copy your package folder to parent folder "node_modules".
Now run:
npm config set prefix C:\Users\[username]\AppData\Roaming\npm
Change the path in environment variables. Set:
C:\Users[username]\AppData\Roaming\npm
Now the package is working correctly with the command line.
I'm not sure if your problem is being caused by the same reason that mine was, but I too was experiencing a hanging "npm install" and was able to fix it.
In my case, I wanted to install typescript locally in the project:
npm i typescript --save-dev
For some reason this was conflicting with a global install of typescript that I had, and the shell was just hanging forever instead of finishing or erroring...
I fixing it by first removing the globally installed typescript with the -g global flag:
npm uninstall typescript -g
After doing this the first command worked! 👍
I had npm hanging on installation of electronjs on Windows 10. I reinstalled and still it was hanging. But I noticed it got installed on another desktop in the same network. So finally I found the culprit. The issue was caused by Bitdefender free edition. There was no warning by the antivirus but it was blocking it silently. Even the console was not closing once the installation starts as it kept hanging. Disable antivirus/firewall if its on Windows and make sure network is open as npm does not seem to have a proper way of communicating network blocks and will keep proceeding indefinitely.
I've hit this problem a couple times.
When I was on VPN, I pressed Ctrl-C and disconnected from the VPN. Then npm install worked.
When I wasn't on VPN, I pressed Ctrl-C and connected to the VPN. Then, again, npm install worked.
For anyone on MacOS (I'm on Mojave 10.14), the following helped me out:
https://github.com/reactioncommerce/reaction/issues/1938#issuecomment-284207213
You'd run these commands
echo kern.maxfiles=65536 | sudo tee -a /etc/sysctl.conf
echo kern.maxfilesperproc=65536 | sudo tee -a /etc/sysctl.conf
sudo sysctl -w kern.maxfiles=65536
sudo sysctl -w kern.maxfilesperproc=65536
ulimit -n 65536
Then try npm install once more.
check your environment variables for http and https
The existing entries might be creating some issues. Try deleting those entries.
Run "npm install" again.
I just turn off my windows firewall and it worked for me.
You can also try different versions of npm.
Check your .npmrc file for a registry entry (which identifies a server acting as a package cache.)
For me, npm install would hang partway through, and it was because of a old / non-responsive server listed in my .npmrc file. Remove the line or comment it out:
>cat ~/.npmrc
#registry=http://oldserver:4873
(And/or check with your IT / project lead as to why it's not working ;)
install nvm (Node Version Manager) and downgrade node version from 14 to 12 solved the issue in my case
Uninstalling and installing node and npm worked for me. I'm using Ubuntu 20.04.1 LTS
In my case npm install was hanging because it was waiting for me to input a password to my ssh key while cloning from git repository. There was no prompt and I realized this might be the case when I typed random character and nothing was echoed back. In my case I had to look at package.json file and clone locally repositories listed there. Then I updated package.json and changed paths of those git repositories to my local paths. After doing this everything else was installed without further errors.
On windows i suddenly had the same issue and tried all of the above, but the final solution for me was to switch off the ransomware protection which I had activated. It somehow doesn´t go well along with npm
I was having this error because I was running npm in a (docker) container in WSL2, and docker in WSL2 was configuring the wrong nameservers in the containers, making the container unable to resolve hosts.
To see if your container (or even your host) can resolve hosts, you can try running: curl https://github.com. In my case I received curl: (6) Could not resolve host: github.com.
The error in the docker container doesn't happen if I don't use the default bridge, instead I used a custom bridge and defined the container with it, in which case the resolv.conf file ends up with the correct nameserver:
$ cat /etc/resolv.conf
nameserver 127.0.0.11
options ndots:0
The ip 127.0.0.11 corresponds to the docker DNS server, solving the problem in my case.
If you aren't running npm in a container, your issue may still be related to some misconfigured resolv.conf file (if you are in a Linux machine, or in Windows with WSL/WSL2).
In case anyone else encounters this, I left the npm install to run for long enough, and then the Jest extension crashed (v4.2.1), at which point the npm install completed successfully.
The Jest configuration seems to show that a test auto-watch feature was enabled. I haven't changed any Jest settings as far as I'm aware, so this must be out-of-the-box functionality.

Resources