0Day Forums
npm install gets stuck at fetchMetadata - Printable Version

+- 0Day Forums (https://0day.red)
+-- Forum: Coding (https://0day.red/Forum-Coding)
+--- Forum: NodeJs (https://0day.red/Forum-NodeJs)
+--- Thread: npm install gets stuck at fetchMetadata (/Thread-npm-install-gets-stuck-at-fetchMetadata)

Pages: 1 2 3


npm install gets stuck at fetchMetadata - peripatus414991 - 07-21-2023

I'm currently unable to run `npm install` in any project since today.
I'm running node v8.2.1 & npm 5.3.0 (installed via nvm).

When typing `npm install` it gets stuck on `fetchMetadata` everytime:
`⸨ ░░░░░░░░░░░░░░░░⸩ ⠧ fetchMetadata: sill pacote range manifest for longest@^1.0.1 fetched in 197ms`

I've tried switching back to `npm 5.0.3` which worked flawless, but still get stuck.

**Details to my computer:** MacBook Pro running `macOS 10.12.6`


RE: npm install gets stuck at fetchMetadata - botchy166 - 07-21-2023

I have experienced this and fixed it with `rm -rf ~/.npm` or `npm cache clean`.

If that doesn't work, perhaps install with Homebrew instead of nvm, to eliminate some possibilities.


RE: npm install gets stuck at fetchMetadata - desdemonabtnz - 07-21-2023

As a first thing, run `npm install --verbose` to see more!

*What happened in my case:*

In your `package.json` search for packages you directly get from Github. In my case such a package did not exist anymore.
Such lines look like

"NAME_OF_PACKAGE": "git+ssh://[email protected]/SOME_USER/NAME_OF_PACKAGE.git",

Remove the package, fix the name/location or change to the npm version of the package.

---

**Further note**: I got several other similar errors, all the same but the package name was different from `longest@^1.0.1`. I also had `p-try@something` or `array-ify@something`

---

For me all that didn't work: `rm -rf ~/.npm`, `npm cache clean` or `rm package-lock.json` **all didn't work**!


RE: npm install gets stuck at fetchMetadata - fireworky924681 - 07-21-2023

I solve this issue by opening the **package-lock.json** and reset all the json. Delete the current content and replace it with

> {}

then reinstall the package.


RE: npm install gets stuck at fetchMetadata - nanga234938 - 07-21-2023

1. REASON: the reason for this is:
the cli do not prompt: "Enter passphrase for /home/USERS/.ssh/id_rsa:"
and I used to get the prompt correctly in npm@5, but update to npm@6, it occurs.
2. SOLVE:
\# eval \`ssh-agent\`
\# ssh-add
//automaticlly enter passphrase, without maunally operating.


RE: npm install gets stuck at fetchMetadata - cutcheon697 - 07-21-2023

The question is quite old but I've fallen into this scenario these days.

I tried every suggestion I read to solve the problem related to the npm installation process (npm cache clear and verify, uninstall and reinstall the package, uninstall and install everything and so on...) that looks like the "locked-in" syndrome. Nothing was successful in my case.

Once I found that my network was fully up and running without any firewall, proxy and/or strange routing rules I started installing packages with (example for the cli) `npm install -g @angular/cli --verbose` and I discovered that all the connections to the URL `registry.npmjs.org` were done in https. This was the problem in my case.

For an unknown reason npm fails in a not very clear condition during the connection with the remote server, without any network error or warning. Simply it takes an huge amount of time to retrieve the data. Permissions? SSL certificates or some specific checking on it? Some strange route on the net?

At the moment are just a speculations. I left the computer running all night and the packages were installed correctly but this is crazy. Isn't it?

After switching the connections to http with the command `npm config set registry

[To see links please register here]

--global` everything has worked fine in a reasonable time for the installation packages process.

Probably there is something more that I'm missing but in my case the plain http has resolved the problem.

Ubuntu 18.04.1 LTS / node v8.12.0 / npm 6.4.1 / nvm 0.33.11


RE: npm install gets stuck at fetchMetadata - Mrgeorgiarbtxzdfgyo - 07-21-2023

In my case removing packge connected to the one that loads forever solve issue

"swagger-core-api": "apigee-127/swagger-core-api" //removing this
But the real reason of similar problems is project without full git data pushed to github(due to mess in .gitconfig). Then github clone copy files that not match one in repository (or Download ZIP).


RE: npm install gets stuck at fetchMetadata - girish427 - 07-21-2023

Probably not the best solution, but my workaround was to push up my active branches to origin, re-clone my repo into a different folder, then npm install in the new folder.


RE: npm install gets stuck at fetchMetadata - ploughman657 - 07-21-2023

I got stuck when doing `npm install` with couchdb-fauxton, I normally sit behind a corporation firewall and uses proxy everywhere, but switched to a direct connection, because using `npm config proxy` didn't work out for me. **But the npm install uses `git`,** which I still set to use proxy, that's how my install got stuck. After disable the proxy in git, it worked.


RE: npm install gets stuck at fetchMetadata - myotome490580 - 07-21-2023

Adding to @CptUnlucky's answer.

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

This forces the http fetch. If this alone doesn't work, throttle the number of simultaneous connections that can be established. Default Max connections is 50.

npm set maxsockets 3


That worked for me.