gyp ERR! stack Error: Python executable “/usr/local/bin/python” is v3.6.4, which is not supported by gyp.

解决方法:

brew install python@2
brew link python@2

➜  ~ which python2.7
/usr/bin/python2.7

echo "python=/usr/bin/python2.7" >> ~/.npmrc

参考链接: https://github.com/mapbox/node-pre-gyp/issues/352 https://github.com/nodejs/node-gyp/issues/1388