AnaCS
AnaCS

Reputation: 1011

Stuck at npm install at fechMetadata checking installable status

Suddently I can't install angular I get stuck at the npm install command "npm install -g @angular/cli" It stays forever on this "checking installable status".

my node version is 8.11.3 (yes I already tried to uninstall node and double checked to see it was really uninstalled) this was the version I had before and was working fine my npm -v gives 5.6.0

then I run the angular command to install angular and it seems to freezing or very very very slow....

Upvotes: 25

Views: 25093

Answers (10)

Ondrej Peterka
Ondrej Peterka

Reputation: 3427

Or maybe there is a service outage as in my case. Recommending to first check the status page, where you get the info, if everything is working as it should be: https://status.npmjs.org/

If you see something like this, you know, you will have to wait for a while:

enter image description here

Upvotes: 0

John Corrales
John Corrales

Reputation: 94

To anyone still experiencing this, I spent days searching for a solution, it ended up being easier and more effective to just remove all traces of nvm (and its node) from my machine and reinstall. Everything started working smooth again after the reinstall

I did:

brew uninstall nvm
rm -rf $NVM_DIR ~/.nvm ~/.npm ~/.bower

# remove nvm entries from my .bash_profile|.bashrc then
# installed nvm from nvm's install script

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.0/install.sh | bash

# add to bash_profile

cat << EOF >> ~/.bash_profile
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
EOF

source ~/.bash_profile
nvm install --lts
 

Upvotes: 4

Venryx
Venryx

Reputation: 18039

For me the issue is that the package I was trying to install had this in its package.json:

"dependencies": {
    [...]
    "mobx-utils": "github:Venryx/mobx-utils#5.5.2_VPatch2"
}

Normally that works fine, but apparently today, NPM decided to hang on the call to retrieve the library contents from the GitHub repo.

I used Process Hacker 2 to investigate what exact command was hanging, and it was the following:

git.exe ls-remote -h -t git://github.com/Venryx/mobx-utils.git

In my case, I worked around the issue by just manually installing the subdependencies (and copy-pasting the mobx-utils library itself), but this is of course not ideal.

UPDATE: The issue is that I was running an outdated version of Git for Windows. Once I updated it to the latest version (v2.28.0), the issue was resolved. (ie. installing based on github urls/branches started working just fine again)

Upvotes: 2

atereshkov
atereshkov

Reputation: 4565

In my case I had to wait for a few minutes and npm finally installed by package. Also I suggest to use --verbose flag to see what's actually is going.

Upvotes: 10

Carherpi
Carherpi

Reputation: 771

npm install -g @angular/cli --verbose

After running this command I realized npm was having problems with the connection with registry.npmjs.org

To solve this:

  1. npm config set registry "http://registry.npmjs.org"
  2. npm set maxsockets 3

Viewed here

Upvotes: 20

It is possible that you have a custom registry set up in your global .npmrc. That was the problem in my case: my company uses a custom registry which falls back to the NPM registry. It is not a problem for work projects, because all the required packages are already present there, but I didn't realize this was affecting a new project whose packages were not included in the mirror registry and looking them all up must have been the cause of the slowdown.

I solved it by resetting the registry config to the NPM registry in an .npmrc for that specific project:

registry=https://registry.npmjs.org

Upvotes: 2

Samarth Saxena
Samarth Saxena

Reputation: 315

Try this: npm install -g --no-optional pm2 This will ignore all the dependencies specified in the package.json file (if present). Hope this helps.

Upvotes: 3

Cito
Cito

Reputation: 5613

You may need to specify your proxy server in the global Git configuration, like this:

git config --global http.proxy http://your-proxy-server:port
git config --global https.proxy http://your-proxy-server:port

And since you mentioned you're using Git for Windows, best to put this into the system wide configuration, too (repeat these commands with --system instead of --global).

Theoretically, the global config should take precedence over the system config, but sometimes when using npm install on Windows, the global config seems to be ignored or not found. I suspect this can happen when there are conflicting settings in the USERPROFILE and HOMESHARE env vars, in which case Git may be confused and look in different places depending on how it is invoked.

Upvotes: 2

Ramana
Ramana

Reputation: 1945

Try npm install --g --no-optional pm2

Check this out for reference

Upvotes: 2

ozo
ozo

Reputation: 1

for those with the same problem try

npm config set strict-ssl false

Upvotes: -3

Related Questions