angular-cli: Infinite Loop with Docker / `npm -g install @angular/cli`
Bug Report or Feature Request (mark with an x
)
- [ x] bug report -> please search issues before submitting
- [ ] feature request
Versions.
Node v8.3.0 NPM v5.3.0
OS: Docker buildpack-deps:jessie
Repro steps.
The log given by the failure.
RUN npm install -g @angular/cli
...removed...
> node-sass@4.5.3 postinstall /usr/local/lib/node_modules/@angular/cli/node_modules/node-sass
> node scripts/build.js
Building: /usr/local/bin/node /usr/local/lib/node_modules/@angular/cli/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ '/usr/local/bin/node',
gyp verb cli '/usr/local/lib/node_modules/@angular/cli/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library=' ]
gyp info using node-gyp@3.6.2
gyp info using node@8.3.0 | linux | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` succeeded python2 /usr/bin/python2
gyp verb check python version `/usr/bin/python2 -c "import platform; print(platform.python_version());"` returned: "2.7.9\n"
gyp verb get node dir no --target version specified, falling back to host node version: 8.3.0
gyp verb command install [ '8.3.0' ]
gyp verb install input version string "8.3.0"
gyp verb install installing version: 8.3.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp WARN EACCES user "undefined" does not have permission to access the dev dir "/root/.node-gyp/8.3.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/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
gyp verb command install [ '8.3.0' ]
gyp verb install input version string "8.3.0"
gyp verb install installing version: 8.3.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.3.0
gyp verb ensuring nodedir is created /usr/local/lib/node_modules/@angular/cli/node_modules/node-sass/.node-gyp/8.3.0
gyp WARN EACCES user "nobody" does not have permission to access the dev dir "/usr/local/lib/node_modules/@angular/cli/node_modules/node-sass/.node-gyp/8.3.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/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
gyp verb command install [ '8.3.0' ]
gyp verb install input version string "8.3.0"
…repeating infinitely…
Note RUN npm install -g node-gyp
seems to work fine.
Desired functionality.
Installs properly
Mention any other details that might be useful.
N/A
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 16
- Comments: 18
Commits related to this issue
- fix: update Dockerfile for infinite loop problem see https://github.com/angular/angular-cli/issues/7389 — committed to mkfsn/shucyan by mkfsn 7 years ago
- Upgrading Node (fixes #762) (#772) Upgrading Node (fixes #762) Issue with insufficient directory permissions see: https://github.com/angular/angular-cli/issues/7389 — committed to CodeForPoznan/volontulo by magul 7 years ago
This bug is still reproducible on
Ubuntu Xenial
andDebian Jessie
. I appreciate that there is a workaround but shouldn’t the issue remain open since there is no actual fix just workarounds?For those coming from google to quickly get around this use this command to install:
the
--unsafe
gets it to complete without the loopStill getting this in March 2018:
This spins into an infinite loop when in gets to the
gyp
build part. Using @PhilThurston’s--unsafe
option helped me.Why is this still a problem?
Same on MacOS High Sierra (node v8.9.4 and npm 5.6.0) below statement looping for more than 2 hours now…
gyp WARN install version not already installed,, continuing with install 8.9.4
Just exited out of installation using Control+C and ng -v works fine 😃
Okay the nodejs/node-gyp#1236 trick/workaround seems to fix it:
Same issue with Node v9.11.1 and NPM 5.6.0
Same here. What I don’t get is why there’s no problem of user when using node 7.9.0.
For now, i’m keeping node 7.9.0.
workaround is here: https://github.com/nodejs/node-gyp/issues/1236#issuecomment-309447800