Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issue installing JSDOM on mac

Tags:

node.js

jsdom

Using this command: npm install jsdom, in an attempt to get jsdom up and running to use with a node.js server, I get the following series of errors. Could somebody please help clarify this issue? I think that there might also be an issue because it cannot install contextify...thanks in advance!

npm http GET https://registry.npmjs.org/jsdom
npm http 304 https://registry.npmjs.org/jsdom
npm http GET https://registry.npmjs.org/htmlparser
npm http GET https://registry.npmjs.org/cssom
npm http GET https://registry.npmjs.org/contextify
npm http 304 https://registry.npmjs.org/contextify
npm http 304 https://registry.npmjs.org/cssom
npm http 304 https://registry.npmjs.org/htmlparser
npm WARN package.json [email protected] No README.md file found!
npm http GET https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/bindings

> [email protected] install /Users/dereklo/node_modules/jsdom/node_modules/contextify
> node-gyp rebuild

gyp ERR! rebuild error Error: not found: make
gyp ERR! rebuild error     at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:43:28)
gyp ERR! rebuild error     at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:46:29)
gyp ERR! rebuild error     at /usr/local/lib/node_modules/npm/node_modules/which/which.js:57:16
gyp ERR! rebuild error     at Object.oncomplete (fs.js:297:15)
gyp ERR! not ok 
npm WARN optional dep failed, continuing [email protected]
[email protected] node_modules/jsdom
├── [email protected]
└── [email protected]
like image 373
Apollo Avatar asked Jul 19 '12 22:07

Apollo


1 Answers

You need GCC to compile these node.js modules.

  1. Go to the App store and download the latest version of Xcode for free.
  2. Install Xcode (the app store actually downloads the "installer" for Xcode)
  3. Start Xcode
  4. Go to Preferences
  5. Go to Downloads
  6. Click on the "install" button after "Command Line Tools"
  7. Reboot

Done! :)

like image 145
onlineracoon Avatar answered Nov 14 '22 22:11

onlineracoon