0

I am trying to work on PUSh notifications for Android/ios using node.js. I am getting the below error when I try to install xml2json. Please help me to fix it

gyp ERR! build error 
gyp ERR! stack Error: not found: make
gyp ERR! stack     at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:43:28)
gyp ERR! stack     at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:46:29)
gyp ERR! stack     at /usr/local/lib/node_modules/npm/node_modules/which/which.js:57:16
gyp ERR! stack     at Object.oncomplete (fs.js:107:15)
gyp ERR! System Darwin 12.5.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/bertils/node_modules/xml2json/node_modules/node-expat
gyp ERR! node -v v0.10.24
gyp ERR! node-gyp -v v0.12.1
gyp ERR! not ok 
npm ERR! node-expat@2.0.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-expat@2.0.0 install script.
npm ERR! This is most likely a problem with the node-expat package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls node-expat
npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 12.5.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "xml2json"
npm ERR! cwd /Users/bertils
npm ERR! node -v v0.10.24
npm ERR! npm -v 1.3.21
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/bertils/npm-debug.log
npm ERR! not ok code 0
mklement0
  • 382,024
  • 64
  • 607
  • 775
Sweety Bertilla
  • 972
  • 10
  • 35

2 Answers2

1

Looks like the make tool is not available on your system.

To fix this, you have 2 options:

  • If you have Xcode already installed:

Go to Xcode > Preferences > Downloads and install the component named "Command Line Tools". All the relevant tools will be placed in /usr/bin.

  • Alternative:

Go to https://developer.apple.com/downloads, sign in with your developer Apple ID and search for "Command Line Tools", then download and install the appropriate file.

mklement0
  • 382,024
  • 64
  • 607
  • 775
0

I was also facing the same issue on linux rhel 7, see if it works for you too, what I found out was that I needed to install gcc libraries on my instance, so I went ahead and removed my node_modules folder and then ran the sudo yum group install "Development Tools", in your case you might want to find the brew equivalent sudo yum group install "Development Tools" or xcode-select --install, and I then ran the npm install again and it worked!

Hope this helps, for issues related to installing gcc libraries and Development tools, one can refer to this url also: Install gcc and dev tools or Mac OS install dev tools