[Errno 2] No such file or directory #14

adion opened this Issue Mar 7, 2012 · 30 comments


None yet

adion commented Mar 7, 2012

OS X 10.6.8—I'm still having the issue described by #9

I followed the install instructions (installing via npm and then Package Control) and just can't seem to get this to work. FWIW, jshint works just fine on the command line.

uipoet was assigned Mar 7, 2012


uipoet commented Mar 7, 2012

The referenced issue was with an earlier version that is no longer applicable.

Since I am also using Mac OS X, but can't reproduce your issue, I'm going to need more details. Would you please post the full error message you are seeing in your Sublime Text 2 console?


uipoet commented Mar 7, 2012

Just had a coworker install from scratch without the issue. I'm suspicious that the older version of Mac OS X you are using is to blame. We are both running 10.7.3.

adion commented Mar 7, 2012

The full error message is:

[Errno 2] No such file or directory

Doesn't really provide you with much more info, I'm afraid. Is there anything else I can provide?

Just installed this package and I'm having the same issue.

I'm running OS 10.6.8.

Clicking Tools > JSHint gives me the following error in the console at the bottom:

[Errno 2] No such file or directory

I opened a file into ST by right clicking on it and selecting Sublime Text 2.


uipoet commented Mar 8, 2012

I have painfully installed Snow Leopard into a VM for reproducing this bug and in fact can't reproduce it...

So now that we can't blame 10.6.8, I'm thinking you guys do not have Node.js installed correctly.

You did install via homebrew, right?!!!

Assuming you did, please verify you have the following in your .bash_profile:

export PATH="/usr/local/bin:/usr/local/sbin:~/node_modules/.bin:/usr/local/share/npm/bin:/usr/local/Library/Aliases:${PATH}"

export NODE_PATH="/usr/local/lib/node_modules:${NODE_PATH}"

Other than that, all I can say is make sure you have the latest Xcode 4.2 for Snow Leopard and the latest Sublime and Package Manger versions.

adion commented Mar 9, 2012

I've got Node.js installed via homebrew and it's working properly. For posterity, here are the contents of both PATH and NODE_PATH on my system:

$ echo $PATH

$ echo $NODE_PATH

Sublime and Package Manager are up-to-date. I am currently only running Xcode 4.0.2, so I'll try upgrading that and will report back with my results.

adion commented Mar 9, 2012

I've updated Xcode to 4.2, but the issue persists.

adion commented Mar 9, 2012

I was running Node.js v0.4.11 and while I have brew on my system, running brew list did not yield Node.js as an installed package. After running brew install node it updated Node.js to v0.6.12

I'm still encountering this error.


uipoet commented Mar 9, 2012

Good that you now have the latest xcode and node. Are you also running the latest npm 1.1.4 and node-jshint 0.5.9 versions? Sorry for all the back and forth, I'm shooting in the dark here.

adion commented Mar 9, 2012

Don't apologize for the back and forth—my issue is resolved!

After updating Node.js, npm broke. I reinstalled npm (pulling the latest) and then installed jshint via npm and voila! Success!

Can we possibly update the README to list required versions of Node.js and any other dependencies (Xcode, npm, etc)?


uipoet commented Mar 9, 2012

Wahoo! I will update the README with a commit that will close this issue. I'm glad you stuck with it. Enjoy!

uipoet closed this in 7557014 Mar 9, 2012

I am still having this issue on the latest 10.7.3 but I am pretty sure I have figured out the cause:

If you install via the bundled .dmg file from nodejs.org, then $NODE_PATH is never set up. This is only done via "brew".

If you ever support the regular install, please let me know.


uipoet commented Jun 12, 2012

@distracteddev The package installer of Node.js uses the same path as brew.

Your $PATH must contain /usr/local/bin. This path is what the JSHint plugin for Sublime Text 2 uses.

You can verify with echo $PATH.

I had this issue/error.

There are known issues/bugs with installing node.js via homebrew on OSX:
In my case, "brew install node" would only install an older, outdated version of node.js.
I guess that was the problem.

I resolved this issue it after:

  • installing node.js with the package installer (node-v0.8.2.pkg) from nodejs.org. Verified the install was good with:
    • "node -v" returning v0.8.2
    • "npm - v" returning 1.1.36
    • previously (with the install via homebrew), those calls returned errors
  • Adding the $PATH and $NODE_PATH exports to my ~/.bash_profile as mentioned above

For reference, I have OSX 10.6.6 Snow Leopard, and Xcode version 3.2.5.
I didn't need to update Xcode to fix my problem, as someone suggested above.

I'm having this same problem. Running:

  • Sublime Text v2.0.1 B2217
  • Node.js v0.8.15
  • npm v1.1.66
  • XCode Command Line Tools
  • PATH: /usr/local/bin:/usr/local/sbin:~/node_modules/.bin:/usr/local/share/npm/bin:/usr/local/Library/Aliases:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
  • NODE_PATH: /usr/local/lib/node_modules:

I can run jshint [file] from the command line and get output, but when I run it from Sublime Text I get this:

[Errno 2] No such file or directory
[cmd: [u'jshint', u'/Users/cwesley/temp/untitled.js', u'--reporter', u'/Users/cwesley/Library/Application Support/Sublime Text 2/Packages/JSHint/reporter.js']]
[dir: /Users/cwesley/temp]
[path: /usr/local/bin:/opt/local/bin]

Any ideas?

@cointilt cointilt added a commit to cointilt/sublime-jshint that referenced this issue Dec 18, 2012

@cointilt cointilt Fixes a problem with Sublime Text 2 on Mac
This fixed an issue that was not allowing the build when hitting `cmd` + `j` on Sublime Text 2 for Mac.

Related to issue #33 as well as closed issues #12 and #14.

i've just install it & having same issue on Ubuntu 12.10 64bit.


uipoet commented Jan 22, 2013

Just merged a change that may address. Mind retesting?

grioja commented Feb 24, 2013

This problem exists because the path to the package directory contains spaces, so when it is executed the spaces are not being escaped, thus the file is not being found.

Has there been any progress on this? Seeing same issue in 10.8.4

FWIW, a coworker had the same error. Installing jshint globally resolved the error.

ionutzp commented Dec 11, 2013

install jshint as a node module globally and it will work also in sublime text 3


uipoet commented Dec 11, 2013

Installing jshint globally as a node module is a requirement, as stated in the readme.md

Same issue here!

I installed using package control.

[Errno 2] No such file or directory
[cmd: [u'jshint', u'/Volumes/Storage/Projects/match-app/app/scripts/config/config.js', u'--reporter', u'/Users/Pablo/Library/Application Support/Sublime Text 2/Packages/JSHint/reporter.js']]
[dir: /Volumes/Storage/Projects/match-app/app/scripts/config]
[path: /usr/local/share/npm/bin:/usr/local/bin:/opt/local/bin]

Any help?


sudo npm install -g jshint

@jamesalley sudo npm install -g jshint helped me, thanks!!!

pherris commented Apr 22, 2015

You should never have to sudo npm install stuff - fix the permissions problem and run without sudo.

Guess this doesn't work with nvm? My path is /Users/seanrucker/.nvm/versions/node/v0.12.7/bin/jshint

jhenaoz commented Sep 18, 2015

i have the same issue with nvm, any idea how to solve it?

jlippold commented Dec 4, 2015

If you're using nvm, you'll have to edit the script by hand each time you upgrade node.

First install jshint globally npm install jshint -g
Find the path to your node version: which node
which returns /Users/XXX/.nvm/versions/node/v5.1.0/bin/node

Then edit: ~/Library/Application Support/Sublime Text 2/Packages/JSHint/JSHint.py https://github.com/uipoet/sublime-jshint/blob/master/JSHint.py#L25

to add that node directory

args['path'] = "/usr/local/share/npm/bin:/usr/local/bin:/opt/local/bin:/Users/XXX/.nvm/versions/node/v5.1.0/bin"

apendua commented Feb 11, 2016

@jlippold I am wondering if there's any good reason not to use the value from os.getenv('PATH');?

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