Ask questionsgyp ERR! stack Error: `make` failed with exit code: 2
I am trying to npm install my packages, and it seems a package named
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
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
(tried with a lot of other versions too: 6.X, 10.X, etc)
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
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
Python Version (if it matters): <!--
node -v and
npm -v -->
$ python -V
Xcode verion (if it matters): <!--
node -v and
npm -v -->
$ /usr/bin/xcodebuild -version
Build version 10B61
<details><summary>Verbose output (from npm or node-gyp):</summary>
email@example.com 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 firstname.lastname@example.org 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! email@example.com install: `node-gyp rebuild` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the firstname.lastname@example.org 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
<!-- Any further details -->
Answer questions henrik
In case someone else finds their way here for the same reason as I did: In my case it wasn't "protagonist" (it was "fsevents" and something else).
My fix was to downgrade node from 12 to 11; I was in a project created on Node 11 and then I tried running it on a new computer with Node 12. Ideally I'd "roll forward" and update dependencies until it works on Node 12, of course, but I didn't want to do that now.