I just bought myself a mac book after using Windows for a long time.
I was trying to work on a MeanJS project that I had been working on.
Doing npm install
Hope my scenario can help someone else.
I had the same problem with the package bcrypt. First, I have tried with npm i -g node-gyp
as suggested by Anne but the problem persisted. Then I read again the error message to have a better understanding of the problem and discovered that the script fails to build the package from scratch - since a precompiled version doesn't exist. In particular, it can't find the g++ command so I solved installing the build-essential
package with sudo apt install build-essential -y
.