sourcey / spectacle

Beautiful static documentation generator for OpenAPI/Swagger 2.0
https://sourcey.com/spectacle
Other
1.28k stars 337 forks source link

macOS install problems #168

Closed cloveras closed 6 years ago

cloveras commented 6 years ago

Hi

I have used Spectacle before (), but have a new Mac, and installation problems on macOS 10.13.6 (17G65).

This is the full output of the installation:

$ sudo npm install -g spectacle-docs
Password:
npm WARN deprecated http2@3.3.7: Use the built-in module in node 9.0.0 or newer, instead
npm WARN deprecated graceful-fs@2.0.3: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated coffee-script@1.7.1: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
/usr/local/bin/spectacle -> /usr/local/lib/node_modules/spectacle-docs/bin/spectacle.js

> phantomjs-prebuilt@2.1.16 install /usr/local/lib/node_modules/spectacle-docs/node_modules/phantomjs-prebuilt
> node install.js

PhantomJS not found on PATH
Downloading https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantomjs-2.1.1-macosx.zip
Saving to /tmp/phantomjs/phantomjs-2.1.1-macosx.zip
Receiving...
  [==============================----------] 76%
Received 16746K total.
Extracting zip contents
Removing /usr/local/lib/node_modules/spectacle-docs/node_modules/phantomjs-prebuilt/lib/phantom
Copying extracted folder /tmp/phantomjs/phantomjs-2.1.1-macosx.zip-extract-1539367247287/phantomjs-2.1.1-macosx -> /usr/local/lib/node_modules/spectacle-docs/node_modules/phantomjs-prebuilt/lib/phantom
chmod failed: phantomjs was not successfully copied to /usr/local/lib/node_modules/spectacle-docs/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs

> node-sass@4.9.3 install /usr/local/lib/node_modules/spectacle-docs/node_modules/node-sass
> node scripts/install.js

Unable to save binary /usr/local/lib/node_modules/spectacle-docs/node_modules/node-sass/vendor/darwin-x64-57 : { Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/spectacle-docs/node_modules/node-sass/vendor'
    at Object.fs.mkdirSync (fs.js:885:18)
    at sync (/usr/local/lib/node_modules/spectacle-docs/node_modules/mkdirp/index.js:71:13)
    at Function.sync (/usr/local/lib/node_modules/spectacle-docs/node_modules/mkdirp/index.js:77:24)
    at checkAndDownloadBinary (/usr/local/lib/node_modules/spectacle-docs/node_modules/node-sass/scripts/install.js:114:11)
    at Object.<anonymous> (/usr/local/lib/node_modules/spectacle-docs/node_modules/node-sass/scripts/install.js:157:1)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
  errno: -13,
  code: 'EACCES',
  syscall: 'mkdir',
  path: '/usr/local/lib/node_modules/spectacle-docs/node_modules/node-sass/vendor' }

> node-sass@4.9.3 postinstall /usr/local/lib/node_modules/spectacle-docs/node_modules/node-sass
> node scripts/build.js

Building: /usr/local/bin/node /usr/local/lib/node_modules/spectacle-docs/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/spectacle-docs/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.8.0
gyp info using node@8.11.3 | darwin | 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/local/bin/python2
gyp verb check python version `/usr/local/bin/python2 -c "import sys; print "2.7.15
gyp verb check python version .%s.%s" % sys.version_info[:3];"` returned: %j
gyp verb get node dir no --target version specified, falling back to host node version: 8.11.3
gyp verb command install [ '8.11.3' ]
gyp verb install input version string "8.11.3"
gyp verb install installing version: 8.11.3
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 8.11.3
gyp verb ensuring nodedir is created /Users/cl/.node-gyp/8.11.3
gyp WARN EACCES user "root" does not have permission to access the dev dir "/Users/cl/.node-gyp/8.11.3"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/spectacle-docs/node_modules/node-sass/.node-gyp"
gyp verb tmpdir == cwd automatically will remove dev files after to save disk space
gyp verb command install [ '--node_gyp_internal_noretry', '8.11.3' ]
gyp verb install input version string "8.11.3"
gyp verb install installing version: 8.11.3
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 8.11.3
gyp verb ensuring nodedir is created /usr/local/lib/node_modules/spectacle-docs/node_modules/node-sass/.node-gyp/8.11.3
gyp WARN install got an error, rolling back install
gyp verb command remove [ '8.11.3' ]
gyp verb remove using node-gyp dir: /usr/local/lib/node_modules/spectacle-docs/node_modules/node-sass/.node-gyp
gyp verb remove removing target version: 8.11.3
gyp verb remove removing development files for version: 8.11.3
gyp WARN install got an error, rolling back install
gyp verb command remove [ '8.11.3' ]
gyp verb remove using node-gyp dir: /usr/local/lib/node_modules/spectacle-docs/node_modules/node-sass/.node-gyp
gyp verb remove removing target version: 8.11.3
gyp verb remove removing development files for version: 8.11.3
gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/spectacle-docs/node_modules/node-sass/.node-gyp'
gyp ERR! System Darwin 17.7.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/spectacle-docs/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /usr/local/lib/node_modules/spectacle-docs/node_modules/node-sass
gyp ERR! node -v v8.11.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: phantomjs-prebuilt@2.1.16 (node_modules/spectacle-docs/node_modules/phantomjs-prebuilt):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: phantomjs-prebuilt@2.1.16 install: `node install.js`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.9.3 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-sass@4.9.3 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/cl/.npm/_logs/2018-10-12T18_00_50_642Z-debug.log
cloveras commented 6 years ago

And the debug log: https://www.dropbox.com/s/v276vlbtk1go9ev/2018-10-12T18_00_50_642Z-debug.log?dl=0

cloveras commented 6 years ago

Undo! Seems I needed to do some updating of npm and other modules. Works now:

$ npm install -g spectacle-docs
npm WARN deprecated http2@3.3.7: Use the built-in module in node 9.0.0 or newer, instead
npm WARN deprecated graceful-fs@2.0.3: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated coffee-script@1.7.1: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
/usr/local/bin/spectacle -> /usr/local/lib/node_modules/spectacle-docs/bin/spectacle.js
+ spectacle-docs@1.0.6
updated 1 package in 17.018s