Cannot install with npm 5
Graham42 opened this issue · comments
Graham McGregor commented
Steps to reproduce.
- Open a fresh terminal (you're going to need to force close this)
- Run
docker run --rm -it node:8 npm install -g spectacle-docs@1.0.3
- terminal will get through most of install and then spam this repeatedly:
gyp verb tmpdir == cwd automatically will remove dev files after to save disk space
gyp verb command install [ '10.0.0' ]
gyp verb install input version string "10.0.0"
gyp verb install installing version: 10.0.0
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 10.0.0
gyp verb ensuring nodedir is created /usr/local/lib/node_modules/spectacle-docs/node_modules/node-sass/.node-gyp/10.0.0
gyp WARN EACCES user "nobody" does not have permission to access the dev dir "/usr/local/lib/node_modules/spectacle-docs/node_modules/node-sass/.node-gyp/10.0.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/spectacle-docs/node_modules/node-sass/.node-gyp"
I was able to narrow this specifically to npm 5 because if you run the following, it installs fine using node:8 and npm@4
docker run --rm -it node:8 sh
# inside docker shell
$ npm install -g npm@4
$ npm -v
# should be 4.6.1
$ npm install -g spectacle-docs@1.0.3
# will work
Hugo Conceicao commented
Same here.
Martin Murphy commented
try npm 6.1.0 packaged with node 8.9.3
Graham McGregor commented
Appears fixed with
Node: v8.11.4
npm@6.4.1
spectacle-docs@1.0.5
Sample Dockerfile
FROM node:8
RUN npm install -g npm@^6
RUN npm install -g --unsafe-perm spectacle-docs@1.0.5
Need the --unsafe-perm
if installing as root
See nodejs/node-gyp#1271 (comment)