Angular-cli: Infinite install loop

Created on 10 Sep 2017  路  15Comments  路  Source: angular/angular-cli

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

1.4.1

Repro steps.

sudo npm install -g @angular/cli@latest

The log given by the failure.

The following repeats itself forever:

gyp verb command install [ '8.4.0' ]
gyp verb install input version string "8.4.0"
gyp verb install installing version: 8.4.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 8.4.0
gyp verb ensuring nodedir is created /usr/lib/node_modules/@angular/cli/node_mod ules/node-sass/.node-gyp/8.4.0
gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr /lib/node_modules/@angular/cli/node_modules/node-sass/.node-gyp/8.4.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_m odules/@angular/cli/node_modules/node-sass/.node-gyp"
gyp verb tmpdir == cwd automatically will remove dev files after to save disk sp ace

Desired functionality.

Install to be working

Mention any other details that might be useful.

1.3.2 was working.
I am on Ubuntu E2 on AWS.

Most helpful comment

Same issue on my Mac. After a few hours of digging, I found that right before the loop starts it can't find python 2 on my system. After installing python with "brew install python", I was able to install angular/cli.

Seems like the real issue is that the angular/cli install depends on python 2, doesn't bother to check to see if you have it installed, and continues on blissfully into eternity without it.

All 15 comments

Now it works, finishing to install with saying:

 + @angular/[email protected]
 added 114 packages and updated 1 package in 11.718s

But if I do ng --version I get

@angular/cli: 1.3.2
node: 8.4.0
os: linux x64

I am still having this trouble.
The same way you've decribed.

+1
@AmitMY : how did you solve it? Did you just wait?

@AmitMY the version of the CLI reported may be from the local project, not your global version.

Unfortunately there's not a whole lot we can do regarding failing or long-running npm installs. You could try reaching out to the npm team.

Had the same issue installing globally. But when I asked for the version with ng --version it ran, and told me it wasn't installed in my local project. So I installed it locally, and that ran fine.

i had the same issue in my Fedora 26. It runs a inifinite loop while installing angular.cli. It says doesn't have permission in node-sass . So wat i did was tried once more the npm install -g and then removed the node_modules from /usr/lib/node_modules/@angular/cli/ and run npm install .

This time the node-gyp bin downloaded successfully and run perfectily. Its some kind of isse with node-sass . The Error is ensuring nodedir is created /usr/lib/node_modules/@angular/cli/node_modules/node-sass/.node-gyp/8.7.0 gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/lib/node_modules/@angular/cli/node_modules/node-sass/.node-gyp/8.7.0" gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/@angular/cli/node_modules/node-sass/.node-gyp" gyp verb tmpdir == cwd automatically will remove dev files after to save disk space

I have this same issue on the newest version of Node. I was able to install after switching from version 8.7.0 to the latest stable version 6.11.4.

Same issue on my Mac. After a few hours of digging, I found that right before the loop starts it can't find python 2 on my system. After installing python with "brew install python", I was able to install angular/cli.

Seems like the real issue is that the angular/cli install depends on python 2, doesn't bother to check to see if you have it installed, and continues on blissfully into eternity without it.

Further to @rjenks comment, I ran into the same problem on my Mac, but I am using MacPorts instead of HomeBrew. The python2 symlink was already there but not in root's PATH. For an unknown reason, running npm with sudo didn't work, so I had to sudo to root. The fix for me was:

sudo su -
PATH=/opt/local/bin:/opt/local/sbin:$PATH
npm install -g @angular/cli@<version>

So, what do we have to do about this?? I don't explicitly use Python on my Mac, so therefore have never explicitly installed it....seems like that's what npm, et al, is supposed to do!
I too am getting the loop of death trying to upgrade from angular cli 1.2 to latest.

Try adding the -unsafe-perm switch. I can鈥檛 remember whether it鈥檚 one hyphen or two. It really needs to be officially documented.

These are the workarounds I used to install angular-cli:

  1. https://stackoverflow.com/a/45536820
  2. add -unsafe-perm -> thx to @citizentim

Anyone have command to install cli without any error?

@stejo009 I believe it has already been mentioned.

sudo npm install -g @angular/cli -unsafe-perm

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

NCC1701M picture NCC1701M  路  3Comments

brtnshrdr picture brtnshrdr  路  3Comments

IngvarKofoed picture IngvarKofoed  路  3Comments

donaldallen picture donaldallen  路  3Comments