Skip to content

Instantly share code, notes, and snippets.

@karlwestin
Created April 2, 2012 07:50
Show Gist options
  • Save karlwestin/2281472 to your computer and use it in GitHub Desktop.
Save karlwestin/2281472 to your computer and use it in GitHub Desktop.
Installing jshint via npm on MacOS X Lion
Are you also having problems installing jshint (or other module) on Lion:
this is what i saw:
npm ERR! Error: ENOENT, chmod
... and loads of other stuff
This worked for me:
1. Clone the node-jshint repo
git clone https://github.com/jshint/node-jshint.git
2. Install from that directory:
cd node-jshint
npm install -g
3. Now i had another problem, one file seemed to be missing:
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module './../packages/jshint/jshint.js'
4. So i cloned the "normal" jshint repo ...
git clone https://github.com/jshint/jshint/
5. ... and copied jshint.js to where node-jshint wanted it
cp jshint/jshint.js /usr/local/lib/node_modules/jshint/packages/jshint/jshint.js
(you might have to create some directories there)
@Marak
Copy link

Marak commented Apr 2, 2012

What does your npm -v report?

Either way, rm -rf usr/local/lib/node_modules/ and reinstall npm.

@karlwestin
Copy link
Author

Hi Marak!
Thanks for havin a look at this,
you where right, the old npm version was my problem, i was on 1.1.12

So i re-installed npm and now i could handle this the normal way..

Cheers man!

@Marak
Copy link

Marak commented Apr 2, 2012

:-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment