npm install failing gyp ERR! stack Error: `make` failed with exit code: 2 and npm ERR! Failed at the fibers@1.0.15 install script.

What I Wanted to Do

I am trying to compile my project which is based on node.js framework - bluecat. It was working fine in Mac OS high Sierra and earlier version of Mac OS Mojave. But with my current version after Apple OS auto update the project is not compiling and I am getting errors.

What Happened Instead

$ npm install

fibers@1.0.15 install /Users/vn0fu0s/Desktop/Walmart/Mex_API_Automation/node_modules/bluecat/node_modules/fibers
node build.js || nodejs build.js

CXX(target) Release/obj.target/fibers/src/fibers.o
…/src/fibers.cc:70:58: error: no template named ‘Handle’
void Reset(Isolate* isolate, Persistent& persistent, Handle handle) {
^
…/src/fibers.cc:83:7: error: variable has incomplete type ‘void’
void SetInternalPointer(Handle handle, int index, void* val) {
^
…/src/fibers.cc:83:26: error: use of undeclared identifier ‘Handle’
void SetInternalPointer(Handle handle, int index, void* val) {
^
…/src/fibers.cc:83:33: error: ‘T’ does not refer to a value
void SetInternalPointer(Handle handle, int index, void* val) {
^
…/src/fibers.cc:82:18: note: declared here
template
^
…/src/fibers.cc:83:36: error: use of undeclared identifier ‘handle’
void SetInternalPointer(Handle handle, int index, void* val) {
^
…/src/fibers.cc:83:48: error: expected ‘(’ for function-style cast or type construction
void SetInternalPointer(Handle handle, int index, void* val) {
~~~ ^
…/src/fibers.cc:83:59: error: expected ‘(’ for function-style cast or type construction
void SetInternalPointer(Handle handle, int index, void* val) {
~~~~^
…/src/fibers.cc:83:61: error: use of undeclared identifier ‘val’
void SetInternalPointer(Handle handle, int index, void* val) {
^
…/src/fibers.cc:83:65: error: expected ‘;’ at end of declaration
void SetInternalPointer(Handle handle, int index, void* val) {
^
;
…/src/fibers.cc:83:66: error: expected unqualified-id
void SetInternalPointer(Handle handle, int index, void* val) {
^
…/src/fibers.cc:87:27: error: use of undeclared identifier ‘Handle’
void* GetInternalPointer(Handle handle, int index) {
^
…/src/fibers.cc:87:34: error: ‘T’ does not refer to a value
void* GetInternalPointer(Handle handle, int index) {
^
…/src/fibers.cc:86:18: note: declared here
template
^
…/src/fibers.cc:87:37: error: use of undeclared identifier ‘handle’
void* GetInternalPointer(Handle handle, int index) {
^
…/src/fibers.cc:87:49: error: expected ‘(’ for function-style cast or type construction
void* GetInternalPointer(Handle handle, int index) {
~~~ ^
…/src/fibers.cc:87:55: error: expected ‘;’ at end of declaration
void* GetInternalPointer(Handle handle, int index) {
^
;
…/src/fibers.cc:87:56: error: expected unqualified-id
void* GetInternalPointer(Handle handle, int index) {
^
…/src/fibers.cc:92:2: error: no template named ‘Handle’
Handle Deref(Isolate* isolate, Persistent& handle) {
^
…/src/fibers.cc:97:7: error: variable has incomplete type ‘void’
void Return(Handle handle, const Arguments& args) {
^
…/src/fibers.cc:97:14: error: use of undeclared identifier ‘Handle’
void Return(Handle handle, const Arguments& args) {
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [Release/obj.target/fibers/src/fibers.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/vn0fu0s/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at ChildProcess.emit (events.js:200:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 18.6.0
gyp ERR! command “/Users/vn0fu0s/Desktop/Walmart/Mex_API_Automation/node_modules/node/bin/node” “/Users/vn0fu0s/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” “rebuild” “–release”
gyp ERR! cwd /Users/vn0fu0s/Desktop/Walmart/Mex_API_Automation/node_modules/bluecat/node_modules/fibers
gyp ERR! node -v v12.4.0
gyp ERR! node-gyp -v v3.6.2
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 EINVAL: invalid argument, rmdir ‘/Users/vn0fu0s/Desktop/Walmart/Mex_API_Automation/node_modules/bluecat/node_modules/fibers/build/Release/.deps/Release/obj.target/fibers/src’
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! fibers@1.0.15 install: node build.js || nodejs build.js
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the fibers@1.0.15 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/vn0fu0s/.npm/_logs/2019-06-14T07_38_19_708Z-debug.log

Details

113 verbose stack Error: fibers@1.0.15 install: node build.js || nodejs build.js
113 verbose stack spawn ENOENT
113 verbose stack at ChildProcess. (/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18)
113 verbose stack at emitTwo (events.js:126:13)
113 verbose stack at ChildProcess.emit (events.js:214:7)
113 verbose stack at maybeClose (internal/child_process.js:925:16)
113 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
114 verbose pkgid fibers@1.0.15
115 verbose cwd /Users/vn0fu0s/Desktop/Walmart/Mex_API_Automation
116 verbose Darwin 18.6.0
117 verbose argv “.nvm/versions/node/v8.9.1/bin/node” “/Users/vn0fu0s/.nvm/versions/node/v8.9.1/bin/npm” “install”
118 verbose node v8.9.1
119 verbose npm v5.5.1
120 error file sh
121 error code ELIFECYCLE
122 error errno ENOENT
123 error syscall spawn
124 error fibers@1.0.15 install: node build.js || nodejs build.js
124 error spawn ENOENT
125 error Failed at the fibers@1.0.15 install script.

Platform Info

$ npm --versions
5.5.1

$ node -p process.platform
darwin

$ node --versions
8.9.1

$ xcodebuild --versions
Xcode 10.2.1
Build version 10E1001$ 

$gcc --versions
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

$brew -v
Homebrew 2.1.5

$nvm --version
0.34.0

**MAC OS**
Mojave 10.14.5

$nvm ls
->       v8.9.1
default -> 8.9.1 (-> v8.9.1)
node -> stable (-> v8.9.1) (default)
stable -> 8.9 (-> v8.9.1) (default)
iojs -> N/A (default)
unstable -> N/A (default)
lts/* -> lts/dubnium (-> N/A)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.16.0 (-> N/A)
lts/dubnium -> v10.16.0 (-> N/A)