0

I am unable to install the angular cli from the npm and its getting stuck asking to loadAllDepsIntoIdealTree.

Steps taken:

C:\Windows\system32\node -v

v6.11.1

C:\Windows\system32\npm -v

3.10.10

C:\Windows\system32\npm install -g @angular/cli

Its gets stuck with the attached error

enter image description here

user2237857
  • 51
  • 2
  • 7
  • 1
    you probably already have an angular-cli `serve` running – Poul Kruijt Jul 26 '17 at 11:26
  • Are you running this as an adminstrator? – R. Richards Jul 26 '17 at 11:33
  • I didn't notice any error on your screenshot, is it frozen on `loadAllDepsIntoIdealTree` step? – Haseoh Jul 26 '17 at 11:43
  • Are you running these commands from behind a proxy? If you are you could try [this question](https://stackoverflow.com/questions/7559648/is-there-a-way-to-make-npm-install-the-command-to-work-behind-proxy) – 0mpurdy Jul 26 '17 at 12:37
  • @PierreDuc - Thanks for your comment. I am installing angular-cli for the first time. No angular-cli is running as I am unable to install it on the first place – user2237857 Jul 26 '17 at 15:36
  • @R.Richards - Thanks for your comment. Yes I am running it as an administrator. Shall I or Shall I not ? – user2237857 Jul 26 '17 at 15:37
  • @Haseoh - Thanks for your comment. Yes. Its now showing any error. It just gets stuck at this point and does not proceeds even after hours. – user2237857 Jul 26 '17 at 15:39
  • Running as admin is correct. This is a strange one! Good luck. – R. Richards Jul 26 '17 at 15:54

2 Answers2

4

I also stucked in the same problem. Below solution works for me.

It would be better if you upgrade your node and npm versions to latest. After that please follow the below steps to install the angular/cli:

Open your command prompt with administrative privileges and uninstall angular/cli by using npm uninstall -g angular-cli command.

Remove node_modules directory and then clear the cache by using npm cache clear --force command.

Remove C:\Users\<username>\AppData\Roaming\npm\ and C:\Users\<username>\AppData\Roaming\npm-cache.

Try to install the angular/cli@latest by using npm install -g @angular/cli@latest command.

Hope the above trick resolve your issue.

Suhas Gavad
  • 1,199
  • 1
  • 8
  • 12
1

I had the same problem for npm@5.3.0 on macOS. It was resolved by checking my package.json file with validator.

In my case the problem was the git package version notation: gulpjs/gulp.git#4.0 instead of https://github.com/gulpjs/gulp.git#4.0.

After changes I also regenerate package-lock.json.

Alex
  • 11
  • 1