sourcey / spectacle

Beautiful static documentation generator for OpenAPI/Swagger 2.0

Home Page:https://sourcey.com/spectacle

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot install with npm 5

Graham42 opened this issue · comments

Steps to reproduce.

  1. Open a fresh terminal (you're going to need to force close this)
  2. Run docker run --rm -it node:8 npm install -g spectacle-docs@1.0.3
  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

Same here.

try npm 6.1.0 packaged with node 8.9.3

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)