pixelnest / presskit.html

Re-implementation of presskit() as a static site generator
http://pixelnest.io/2017/03/presskit-html/
MIT License
306 stars 51 forks source link

Installation error on macos due to broken python2 installation #13

Closed GabLeRoux closed 5 years ago

GabLeRoux commented 5 years ago
npm i -g presskit
/usr/local/bin/presskit -> /usr/local/lib/node_modules/presskit/bin/presskit

> fsevents@1.2.7 install /usr/local/lib/node_modules/presskit/node_modules/fsevents
> node install

node-pre-gyp WARN Using needle for node-pre-gyp https download
[fsevents] Success: "/usr/local/lib/node_modules/presskit/node_modules/fsevents/lib/binding/Release/node-v67-darwin-x64/fse.node" is installed via remote

> sharp@0.20.8 install /usr/local/lib/node_modules/presskit/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.6.1/libvips-8.6.1-darwin-x64.tar.gz
prebuild-install WARN install No prebuilt binaries found (target=11.12.0 runtime=node arch=x64 platform=darwin)
gyp ERR! configure error
gyp ERR! stack Error: Command failed: /Users/gableroux/.pyenv/shims/python2 -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack pyenv: python2: command not found
gyp ERR! stack
gyp ERR! stack The `python2' command exists in these Python versions:
gyp ERR! stack   2.7.14
gyp ERR! stack
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:297:12)
gyp ERR! stack     at ChildProcess.emit (events.js:197:13)
gyp ERR! stack     at maybeClose (internal/child_process.js:988:16)
gyp ERR! stack     at Socket.stream.socket.on (internal/child_process.js:404:11)
gyp ERR! stack     at Socket.emit (events.js:197:13)
gyp ERR! stack     at Pipe._handle.close (net.js:611:12)
gyp ERR! System Darwin 18.5.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/presskit/node_modules/sharp
gyp ERR! node -v v11.12.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp@0.20.8 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sharp@0.20.8 install 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/gableroux/.npm/_logs/2019-04-05T17_47_26_185Z-debug.log

Just posting this here as this is a problem on my side. If you got this error, more precisely this one:

gyp ERR! stack pyenv: python2: command not found

Then you're using pyenv and you broke your python2 installation. See comment on how to fix this.

GabLeRoux commented 5 years ago

Just make sure you didn't break your system python installation. Here's a summary of what I did:

pyenv global system
brew install python2 python
brew unlink python && brew link python