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
$ node -vv8.11.1Platform:
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:
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:
form the error log, its
[email protected]
Python Version (if it matters):
$ python -V
Python 2.7.16
$ /usr/bin/xcodebuild -versionXcode 10.1Build version 10B61Verbose output (from npm or node-gyp):
[email protected] 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 [email protected] 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 protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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
I am trying to npm install my packages, and it seems a package named
protagonistneedsnode-gypI 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
pythonandxcode toolsetc, 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...
Yes, that error describes the problem. [email protected] seems very old (https://github.com/apiaryio/protagonist/releases) and is setting 'MACOSX_DEPLOYMENT_TARGET': '10.5' in it's gyp scripts (https://github.com/apiaryio/protagonist/blob/7d25ee8622b4f981ecd05aeabd8e730858806aca/common.gypi#L128) which is less than the 10.7 needed to use libc++ on OS X.
I'd suggest updating to a later version of protagonist to see if the problem has been fixed, and if it hasn't raise an issue on their tracker: https://github.com/apiaryio/protagonist/issues
Looks like you need at least [email protected]: https://github.com/apiaryio/protagonist/pull/158/files
@richardlau You are absolutely right!
Thank you very much for your time you took to reply and sorry.
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.



that happened when i runned $ npm install (for react-ssr)
Follow these steps to resolve the issue.
1: Make sure you have build-tools installed.
2: Update node-gyp
3: Delete package-lock.json and node modules folder and run npm install again.
4: Deleting ~/.node-gyp folder and run npm install again.
Source: https://codeforgeek.com/make-failed-with-exit-code-2/
For those who are using AMI 2, I resolve it using
sudo yum groupinstall "Development Tools"
Since my errors were
make: Entering directory `/home/www/tieza-queue/notification/node_modules/fibers/build'
CXX(target) Release/obj.target/fibers/src/fibers.o
make: g++: Command not found
make: *** [Release/obj.target/fibers/src/fibers.o] Error 127
make: Leaving directory `/home/www/tieza-queue/notification/node_modules/fibers/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/ec2-user/.nvm/versions/node/v10.15.3/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:189:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 4.14.114-105.126.amzn2.x86_64
gyp ERR! command "/home/ec2-user/.nvm/versions/node/v10.15.3/bin/node" "/home/ec2-user/.nvm/versions/node/v10.15.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
gyp ERR! cwd /home/www/tieza-queue/notification/node_modules/fibers
gyp ERR! node -v v10.15.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
node-gyp exited with code: 1
Please make sure you are using a supported platform and node version. If you
would like to compile fibers on this machine please make sure you have setup your
build environment--
Windows + OS X instructions here: https://github.com/nodejs/node-gyp
Ubuntu users please run: `sudo apt-get install g++ build-essential`
Alpine users please run: `sudo apk add python make g++`
sh: nodejs: command not found
npm WARN [email protected] requires a peer of acorn@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] install: `node build.js || nodejs build.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] 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! /home/ec2-user/.npm/_logs/2019-06-20T07_19_19_837Z-debug.log
I also experienced this issue, and it seemed my error also referenced fsevents. I believe this was also due to upgrading to Node 12. However @henrik I was able to resolve the issue without downgrading by following @codeforgeek's instructions for the most part.
Make sure node build essentials are installed.
sudo apt-get install build-essential
Delete package-lock.json, /node_modules/ folder, and ~/.node-gyp/ folders.
rm package-lock.json && rm -rf node_modules && rm -rf ~/.node-gyp
Re-run npm install
npm install
if using yarn:
yarn upgrade
@jorwan thank you! That worked seamlessly solving the issues for me.
yarn upgrade worked for me! i was using node 12 on mac 10.15
if using yarn:
yarn upgrade
worked for me in MacOs Catalina
I had the exact same issue after updating to Macos Catalina. After hours wasted looking for a solution, I fixed it by downgrading Node.js to 10.17.0. I hope this helps :)
I downgraded to 10.16.0, and now its working.
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.
Just want to know why node-gyp not support node version 12 or latest.?
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.Just want to know why node-gyp not support node version 12 or latest.?
It does (assuming you are using an up to date version of node-gyp). Issues like these where downgrading Node.js "fixes" the issue are because the module being installed or one of its dependencies is not compatible with the later Node.js version.
Downgraded to v10.18.0 via brew install node@10, It's now working.
In my-case it was failing on Linux-mint 19.2, for some reasons on run-time gcc++ was not accessible.
So by installing the build-essentials error was resolved.
PS:
build-essential package is a reference for all the packages needed to compile a Debian packages. It generally includes the GCC/g++ compilers and libraries and some other utilities. Informational for list of build-essential packages can be found on build-essentials
This is really frustrating. I strongly hope node-gyp can work with node 13.
I look-read-apply many gyp error solution, and only worked "in my case"
I downgraded node 13 to 11 ..
React Native Environment Info:
Binaries:
Node: 11.10.0 - /usr/local/bin/node
Yarn: 1.12.3 - /usr/local/bin/yarn
npm: 6.7.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
IDEs:
Android Studio: 3.0 AI-171.4443003
Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
npmPackages:
react: 16.8.3 => 16.8.3
react-native: ^0.59.10 => 0.59.10
npmGlobalPackages:
react-native-cli: 2.0.1
Node 11 is no longer supported, please choose an LTS version instead - 10 or 12.
Compile errors like this are almost certainly a problem with the addon you're compiling, it's not something we can change here. You need to take it up with the addon author - they need to upgrade their code to work with a newer Node.js, or you need to upgrade the version of the addon you're installing because there's a good chance they've already released a new version.
I downgraded to Node 10.x with Mac OS Catalina, and the issues were solved. I originally had 14.x and tried 12.x too, with no luck.
if using yarn:
yarn upgrade
work !
yarn global upgrade
cd ${yourReposDir}
rm package-lock.json
npm install
I also experienced this issue, and it seemed my error also referenced fsevents. I believe this was also due to upgrading to Node 12. However @henrik I was able to resolve the issue without downgrading by following @codeforgeek's instructions for the most part.
- Make sure node build essentials are installed.
sudo apt-get install build-essential- Delete package-lock.json, /node_modules/ folder, and ~/.node-gyp/ folders.
rm package-lock.json && rm -rf node_modules && rm -rf ~/.node-gyp- Re-run npm install
npm install
It works with windows WSL!
On non macOS platforms, the fsevents messages are warnings, not errors.
https://www.npmjs.com/package/fsevents#troubleshooting
Most helpful comment
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.