Cannot install web3 1.2 on Mac (node-gyp error)

I had an error when trying to install web3@1.2.1 on Mac Mojave, NodeJS vs10. Apparently it’s related to the compilation of the sha3 npm module.

I fixed the error with:

  • running sudo xcodebuild -license
  • removing node_modules directory: rm -rf node_modules
  • re-running npm i web3