NPM does not continue package installation

6

I'm trying to install a simple package with NPM, but the installation does not start, always to the same place.

C:\Users\Gabriel>npm install -g luaparse --verbose
npm info it worked if it ends with ok
npm verb cli [ 'C:\Program Files\nodejs\node.exe',
npm verb cli   'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
npm verb cli   'install',
npm verb cli   '-g',
npm verb cli   'luaparse',
npm verb cli   '--verbose' ]
npm info using [email protected]
npm info using [email protected]
npm verb install initial load of C:\Users\Gabriel\AppData\Roaming\npm\package.json
npm verb readDependencies loading dependencies from C:\Users\Gabriel\AppData\Roaming\npm\package.json
npm verb cache add spec luaparse
npm verb addNamed "*" is a valid semver range for luaparse
npm verb addNameRange registry:https://registry.npmjs.org/luaparse not in flight; fetching
npm verb request uri https://registry.npmjs.org/luaparse
npm verb request no auth needed
npm info attempt registry request try #1 at 16:34:25
npm verb request id 197979e946371ad9
npm http request GET https://registry.npmjs.org/luaparse
-

I've tried other packages, and the same thing happens. Before I tried with version 4.6 and 4.5 of node.js, but I think the problem is on my computer, if you can give a light, I thank you.

Edit: When I was having this problem, I could not ping any ip / address, today I managed to ping, and still I can not download anything.

Edit: I installed node.js 6.19, and it has a new line when I try the same command:

[..................] - normalizeTree: http request GET http://registry.npmjs.org/luaparse

That's where it stops.

    
asked by anonymous 29.09.2016 / 21:37

4 answers

3
  • Disable your router's firewall
  • npm set registry https://registry.npmjs.org/

If it does not work, use a mirror pro npm:

npm config set registry http://skimdb.npmjs.com/registry

Then use the original again:

npm config set registry http://registry.npmjs.org

Edit: Another possible solution would be to specify the registry when installing the package.

First of all, clear the npm cache:

npm cache clean

Then try:

npm install luaparse --registry http://registry.npmjs.org/

Edit2: knowing that you are using DMZ, first of all try to disable the DMZ (reboot required)

Only if you can not disable, because the DMZ is encapsulating DNS, try setting the DNS server to automatic:

netsh interface ip set dns "Local Area Connection" dhcp

Get the ip of your machine using ipconfig then seven as DMZ server (it is in the NAT / DMZ / Advanced settings, depending on your router)

References:

link link link

    
05.10.2016 / 02:53
0

I recommend downloading NVM , which is a version control to use more than one version of the node at the same time. The installation instructions are in README of the project.

After installing install the desired version of the node:

nvm install v4

and after that enable its use:

nvm use v4

Edited:

Try to enable some proxy for npm updates, you can do this as follows for a package only:

npm --proxy http://proxy-server:8080/ install {package-name}

Or you can set the global proxy setting with:

npm config set proxy http://proxy_host:port

Related question: Is there a way to make npm install (the command) to work behind proxy?

Here you can follow a related issue about firewall blocking and misuse of this successfully. And here a question that was migrated from stackoverflow to the superuser about similar problems that used the suggested solution.

The only question left is to have a connection to use as a proxy.

    
05.10.2016 / 02:28
0

Since you did not use sudo, I suppose you are using npm for windows. If it is on windows, install git bash and right after installation right click on git bash -> run as administrator , and then run the command again.

    
13.10.2016 / 05:34
0

Speak Gabriel, here are some things to check:

  • Is GIT installed?
  • Can you give a clone in some external repository (git clone link for example)?
  • Since you have already said that you do not have a proxy, are the http_proxy and / or https_proxy environment variables empty? (check with the set command without parameters)?
  • Are you writable in the directory "C: \ Users \ Gabriel \ AppData \ Roaming \ npm"?
  • If on all these questions you answer yes, try clearing the npm cache, sometimes it corrupts itself and causes strange problems:

    npm cache clean
    
        
    04.10.2016 / 18:26