Useful or not, from you.
node-gyp gyp ERR! stack Error: `make` failed with exit code: 2

I am trying to npm install my packages, and it seems a package named protagonist needs node-gyp

I have literally tried everything I found online (issues here included) and still cant solve this.

2 days I have spent searching around, changing node versions, reinstalling python and xcode tools etc, its driving me crazy.

Where should I focus? Could this be the problem? : clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later) But I have OS X 10.14...

I am literally at my wits end.

Any help really appreciated

<!-- Thank you for reporting an issue. The more information you can give us, the better the chance we can fix your problem.

This issue tracker is for issues with node-gyp, if you have an issue installing a specific module, please file an issue on that module's issue tracker (npm issues modulename). -->

  • Node Version: <!-- node -v and npm -v --> $ node -v v8.11.1 (tried with a lot of other versions too: 6.X, 10.X, etc)

  • Platform: <!-- uname -a (UNIX), or systeminfo | findstr /B /C:"OS Name" /C:"OS Version" /C:"System Type" (Windows) --> macOS Mojave 10.14.3 Darwin USERNAME_Macbook-Pro.local 18.2.0 Darwin Kernel Version 18.2.0: Thu Dec 20 20:46:53 PST 2018; root:xnu-4903.241.1~1/RELEASE_X86_64 x86_64

  • Compiler: <!-- cc -v (UNIX) or msbuild /version & cl (Windows) -->

Apple LLVM version 10.0.0 (clang-1000.11.45.5)
Target: x86_64-apple-darwin18.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
  • Module: <!-- what you tried to build/install --> form the error log, its protagonist@0.17.2

  • Python Version (if it matters): <!-- node -v and npm -v --> $ python -V Python 2.7.16

  • Xcode verion (if it matters): <!-- node -v and npm -v --> $ /usr/bin/xcodebuild -version Xcode 10.1 Build version 10B61

<details><summary>Verbose output (from npm or node-gyp):</summary>

protagonist@0.17.2 install /Users/user/project/project/node_modules/protagonist
node-gyp rebuild

gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
  CXX(target) Release/obj.target/libsnowcrash/snowcrash/src/CBlueprint.o
clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later)
make: *** [Release/obj.target/libsnowcrash/snowcrash/src/CBlueprint.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/user/.nvm/versions/v8.11.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Darwin 18.2.0
gyp ERR! command "/Users/user/.nvm/versions/v8.11.1/bin/node" "/Users/user/.nvm/versions/v8.11.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/user/project/project/node_modules/protagonist
gyp ERR! node -v v8.11.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm WARN marked-terminal@3.2.0 requires a peer of marked@^0.4.0 || ^0.5.0 || ^0.6.0 but none is installed. You must install peer dependencies yourself.
npm WARN project No repository field.
npm WARN project No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! protagonist@0.17.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the protagonist@0.17.2 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/user/.npm/_logs/2019-03-18T23_01_15_767Z-debug.log

</details>

<!-- Any further details -->

That's a useful answer
Without any help

yarn upgrade worked for me! i was using node 12 on mac 10.15