angular-cli: Infinite install loop
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.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 15 (2 by maintainers)
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.
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
@stejo009 I believe it has already been mentioned.
sudo npm install -g @angular/cli -unsafe-perm
Try adding the -unsafe-perm switch. I can’t remember whether it’s one hyphen or two. It really needs to be officially documented.
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:
@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.