Angular-cli: Cannot install angular-cli (yes, I'm using npm v3)

Created on 23 Sep 2016  路  3Comments  路  Source: angular/angular-cli

Please provide us with the following information:

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

OSX El Capitan

  1. Versions. Please run ng --version. If there's nothing outputted, please run
    in a Terminal: node --version and paste the result here:

Cannot install ng, so I cannot give you the version.

$ node -v
v4.5.0
$ npm -v
3.10.8

  1. Repro steps. Was this an app that wasn't created using the CLI? What change did you
    do on your code? etc.

Starting from scratch. Clean install of node/npm. followed by a npm install --upgrade
Now trying "sudo npm install -g angular-cli"

  1. The log given by the failure. Normally this include a stack trace and some
    more information.

npm ERR! Darwin 15.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "angular-cli"
npm ERR! node v4.5.0
npm ERR! npm v3.10.8

npm ERR! uid must be an unsigned int

  1. Mention any other details that might be useful.

Thanks! We'll be in touch soon.

Most helpful comment

It's an npm problem. If you download the current LTS version of node, it gives you the above versions.

npm v3.10.8 has this bug, https://github.com/npm/npm/issues/13946

So my problem was this:

  • the standard node download gives you npm v2
  • angular-cli needs npm v3
  • upgrading npm gives you v3.10.8, which has this bug
  • and once you're on v3.10.8, you can't downgrade to v3.10.7, because of this bug.

My workaround was this:

  • remove /usr/local/bin/npm
  • reinstall the standard node download to get npm v2
    -$ sudo npm install -g --upgrade [email protected], to get the previous version

Will leave this open while I see whether this is a complete fix, but thought I'd post this now, in case it helps someone else.

All 3 comments

It's an npm problem. If you download the current LTS version of node, it gives you the above versions.

npm v3.10.8 has this bug, https://github.com/npm/npm/issues/13946

So my problem was this:

  • the standard node download gives you npm v2
  • angular-cli needs npm v3
  • upgrading npm gives you v3.10.8, which has this bug
  • and once you're on v3.10.8, you can't downgrade to v3.10.7, because of this bug.

My workaround was this:

  • remove /usr/local/bin/npm
  • reinstall the standard node download to get npm v2
    -$ sudo npm install -g --upgrade [email protected], to get the previous version

Will leave this open while I see whether this is a complete fix, but thought I'd post this now, in case it helps someone else.

I needed to uninstall and then reinstall angular-cli, but otherwise, this is now working for me.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sysmat picture sysmat  路  3Comments

brtnshrdr picture brtnshrdr  路  3Comments

delasteve picture delasteve  路  3Comments

NilsHolger picture NilsHolger  路  3Comments

daBishMan picture daBishMan  路  3Comments