73rhodes / Sublime-JSLint

JSLint for Sublime Text 2 and 3.
80 stars 14 forks source link

[Errno 2] No such file or directory #8

Closed aml2326 closed 11 years ago

aml2326 commented 11 years ago

Maybe it's something I'm doing wrong or something that changed on my system that's caused my error but It was working at one point and now its not.

I've upgrade node js to v0.10.1, confirmed in terminal by runinng node --version. If I run jslint in terminal it spits out an error saying "No files specified." so I know thats installed as well. I've tried removing the jslint package from sublime and reinstalling a few times just to see if that would fix it be every time I receive the "[Errno 2] No such file or directory" error when saving a JS file. Any thoughts as to how to fix this error?

[Errno 2] No such file or directory [cmd: [u'node', u'/Users/Adam Leder/Library/Application Support/Sublime Text 2/Packages/JSLint/linter.js', u'--sloppy', u'--indent', u'2', u'--node', u'--nomen', u'--vars', u'--plusplus', u'--stupid', u'--todo', u'/private/var/www/mad-athlete/public_html/assets/js/script.js']] [dir: /private/var/www/mad-athlete/public_html/assets/js] [path: /usr/bin:/bin:/usr/sbin:/sbin] [Finished]

It also seems like 'u' is being prepended in front of all the strings for the [cmd:]

Thanks for your help!

aml2326 commented 11 years ago

I saw the ticket from 5 months ago. Running 'which jslint' works fine but 'head -1 which jslint" does not:

Adam-Leders-MacBook-Pro:~ Adam Leder$ which jslint /usr/local/bin/jslint Adam-Leders-MacBook-Pro:~ Adam Leder$ head -1 which jslint head: which: No such file or directory head: jslint: No such file or directory

aml2326 commented 11 years ago

Also, I just wanted to update you that I can run jslint from terminal:

am-Leders-MacBook-Pro:js Adam Leder$ jslint script.js

script.js

1 '$' was used before it was defined.

$(function(){ // Line 4, Pos 1

2 Expected exactly one space between 'function' and '('.

$(function(){ // Line 4, Pos 11

3 Expected exactly one space between ')' and '{'.

$(function(){ // Line 4, Pos 13

4 Missing space between ')' and '{'.

$(function(){ // Line 4, Pos 13

5 Unexpected '(space)'.

$(function(){ // Line 4, Pos 14

6 Missing 'use strict' statement.

CORE.ShowHide.showText='more'; // Line 6, Pos 5

7 'CORE' was used before it was defined.

CORE.ShowHide.showText='more'; // Line 6, Pos 5

8 Missing space between 'showText' and '='.

CORE.ShowHide.showText='more'; // Line 6, Pos 27

9 Missing space between '=' and 'more'.

CORE.ShowHide.showText='more'; // Line 6, Pos 28

10 Missing space between 'hideText' and '='.

CORE.ShowHide.hideText='less'; // Line 7, Pos 27

11 Missing space between '=' and 'less'.

CORE.ShowHide.hideText='less'; // Line 7, Pos 28

12 Missing space between 'maskColor' and '='.

CORE.Overlay.maskColor='#444'; // Line 8, Pos 27

13 Missing space between '=' and '#444'.

CORE.Overlay.maskColor='#444'; // Line 8, Pos 28

14 Missing space between 'maskOpacity' and '='.

CORE.Overlay.maskOpacity=0.90; // Line 9, Pos 29

15 Missing space between '=' and '0.9'.

CORE.Overlay.maskOpacity=0.90; // Line 9, Pos 30

16 'inField' was used before it was defined.

inField.init(); // Line 13, Pos 5
darrenderidder commented 11 years ago

Looking into it; incidentally node-jslint (for 'jslint' on the command line) is no longer required since I've included the jslint.js in the build plugin directly now.

aml2326 commented 11 years ago

Thanks for taking the time to look into this for me, I really appreciate it. I look forward to having jslint working again!

aml2326 commented 11 years ago

Another update.... I've gone as far as completely uninstalling sublime text 2 from my system. I then reinstalled ST2, Package Control, and jsLint and am still experiencing the same error. I have no other packages installed an the default ST2 settings in place

darrenderidder commented 11 years ago

What happens when you type 'which node' ?

aml2326 commented 11 years ago

Adam-Leders-MacBook-Pro:Package Control Adam Leder$ which node /usr/local/bin/node

aml2326 commented 11 years ago

For shits and giggles I download ST3 beta and tried it there with the same error.

darrenderidder commented 11 years ago

Can you provide the contents of your JSLint.sublime-build please. User preferences > package settings > jslint > advanced build settings to view.

aml2326 commented 11 years ago

{ "cmd": [ "node", "${packages}/JSLint/linter.js", // tolerate missing 'use strict' pragma "--sloppy", // suggest an indent level of two spaces "--indent", "2", // assume node.js to predefine node globals "--node", // tolerate unfiltered for in //"--forin", // tolerate dangling _ in identifiers "--nomen", // tolerate many var statements per function "--vars", // tolerate ++ and -- "--plusplus", // tolerate Douglas Crockford "--stupid", "--todo", "$file" ], "fileregex": "^\/.\/([^\/]_)$", "lineregex": ".\/\/ Line ([0-9]_), Pos ([0-9]*)$", "selector": "source.js, source.css, source.json, source.sass, source.less, source.html" }

darrenderidder commented 11 years ago

Not able to reproduce this with node 0.10.1 on Mac OS 10.6.8. Run ls /Users/Adam Leder/Library/Application Support/Sublime Text 2/Packages/JSLint/ to verify linter.js is installed to the right location. Also what is the full path of the js file you're running lint on?

aml2326 commented 11 years ago

Adam-Leders-MacBook-Pro:~ Adam Leder$ ls /Users/Adam Leder/Library/Application Support/Sublime Text 2/Packages/JSLint/ ls: 2/Packages/JSLint/: No such file or directory ls: Leder/Library/Application: No such file or directory ls: Support/Sublime: No such file or directory ls: Text: No such file or directory /Users/Adam: Desktop Documents Downloads Library Movies Music Pictures Public Adam-Leders-MacBook-Pro:~ Adam Leder$ ls "/Users/Adam Leder/Library/Application Support/Sublime Text 2/Packages/JSLint/" Context.sublime-menu Default.sublime-keymap JSLint.pyc JSLint.sublime-settings README.md linter.js Default.sublime-commands JSLint.py JSLint.sublime-build Main.sublime-menu jslint.js package-metadata.json Adam-Leders-MacBook-Pro:~ Adam Leder$

if I run it without quotes it can't find the director if i wrap the path with quotes it finds it fine. can your plugin be updated to use quotes maybe for paths?

darrenderidder commented 11 years ago

Sorry, I assumed spaces would be escaped, or wrapped with quotes. Tab completion will do that for you automatically in bash. Could you please answer the second part? Not sure it's relevant but would like to rule out the possibility.

aml2326 commented 11 years ago

I am aware of having to escape spaces or wrapping them in quotes. But, since im not passing anything to jsLint i figured your plugin was taking care of all that.

Here's the path to the file I'm testing jsLint on: /Users/Adam\ Leder/Desktop/test.js

darrenderidder commented 11 years ago

It handles spaces ok, so I'm not sure what's different on your setup... not able to reproduce it at all.

On Wed, Mar 27, 2013 at 3:02 PM, aml2326 notifications@github.com wrote:

I am aware of having to escape spaces or wrapping them in quotes. But, since im not passing anything to jsLint i figured your plugin was taking care of all that.

Here's the path to the file I'm testing jsLint on: /Users/Adam\ Leder/Desktop/test.js

— Reply to this email directly or view it on GitHubhttps://github.com/darrenderidder/Sublime-JSLint/issues/8#issuecomment-15546390 .

aml2326 commented 11 years ago

Hmmm, anything else you can think to check?

I just installed ST2 on my wife's MBP and I'm getting the same error: Macbook Pro 10.6.8 Build 10k549

Sublime 2.0.1 Build 2217

node.js v0.10.1

which node: /usr/local/bin/node

My MBP that we were troubleshooting on throughout the day is running Mountain Lion 10.8.3

darrenderidder commented 11 years ago

See if specifying the full path to node in the build settings helps. '/usr/local/bin/node' instead of just 'node'. Will try to reproduce on newer version of Sublime...

aml2326 commented 11 years ago

Great news, that did the trick!

My JSLint.sublime-build file now looks like this:

{ "cmd": [ "/usr/local/bin/node", "${packages}/JSLint/linter.js", // tolerate missing 'use strict' pragma "--sloppy", // suggest an indent level of two spaces "--indent", "2", // assume node.js to predefine node globals "--node", // tolerate unfiltered for in //"--forin", // tolerate dangling _ in identifiers "--nomen", // tolerate many var statements per function "--vars", // tolerate ++ and -- "--plusplus", // tolerate Douglas Crockford "--stupid", "--todo", "$file" ], "fileregex": "^\/.\/([^\/]_)$", "lineregex": ".\/\/ Line ([0-9]_), Pos ([0-9]*)$", "selector": "source.js, source.css, source.json, source.sass, source.less, source.html" }

darrenderidder commented 11 years ago

How did you do your upgrade to node 0.10.1? Did you use a version management tool or install the Mac binary or compile from source or what?

On 2013-03-28, at 8:42 AM, aml2326 notifications@github.com wrote:

Great news, that did the trick!

My JSLing.sublime-build file now looks like this:

{ "cmd": [ "/usr/local/bin/node", "${packages}/JSLint/linter.js", // tolerate missing 'use strict' pragma "--sloppy", // suggest an indent level of two spaces "--indent", "2", // assume node.js to predefine node globals "--node", // tolerate unfiltered for in //"--forin", // tolerate dangling _ in identifiers "--nomen", // tolerate many var statements per function "--vars", // tolerate ++ and -- "--plusplus", // tolerate Douglas Crockford "--stupid", "--todo", "$file" ], "fileregex": "^\/.\/([^\/]_)$", "lineregex": ".\/\/ Line ([0-9]_), Pos ([0-9]*)$", "selector": "source.js, source.css, source.json, source.sass, source.less, source.html" }

— Reply to this email directly or view it on GitHubhttps://github.com/darrenderidder/Sublime-JSLint/issues/8#issuecomment-15586364 .

aml2326 commented 11 years ago

I downloaded the package and ran the installer. http://nodejs.org/dist/v0.10.1/node-v0.10.1.pkg

mwq27 commented 11 years ago

adding "/usr/local/bin/node" instead of just "node" worked for me too. I was having this exact same problem :) Thanks for looking into this guys

electblake commented 11 years ago

confirming the /usr/local/bin/node fix as well.

Note: I had node/jslint both installed correctly and working standalone via commandline. So i'm wondering if this error cropped up b/c I don't use bash on my cli (I used zsh). So maybe my PATH wasn't completely figured properly for bash or whatever ST is assuming.

If anyone is interesting, this doc might shed some light. https://sublime-text-unofficial-documentation.readthedocs.org/en/latest/file_processing/build_systems.html?highlight=build

Thanks for help :)

darrenderidder commented 11 years ago

You can always fix your path in your bashrc file. Not sure yet why node is available on CLI yet not via python. Removing the /usr/local/bin prefix was just an attempt to support windows without a whole new section in the build config.

darrenderidder commented 11 years ago

janraasch's fix moves the node command into user settings. So the node command can be set to match your local system.

cubicmushroom commented 11 years ago

I've updated my node path & fixed for me too. Thanks for the support :o)

kgibs commented 10 years ago

Neither updating the jslint.sublime-build file nor adding ["/usr/local/bin/node", "~/Library/Application Support/Sublime Text 2/Packages/JSLint/linter.js"] to my user prefs solved this for me. the exact output i am getting is:

[Errno 2] No such file or directory
[cmd:  [u'node', u'/Users/kelleygibson/Library/Application Support/Sublime Text 2/Packages/JSLint/linter.js', u'--predef', u"['angular', 'document', '\\$', '_', 'JQuery', 'FB']", u'--sloppy', u'--indent', u'2', u'--node', u'--nomen', u'--vars', u'--plusplus', u'--stupid', u'--todo', u'/Users/kelleygibson/Desktop/deleteme.js']]
[dir:  /Users/kelleygibson/Desktop]
[path: /usr/bin:/bin:/usr/sbin:/sbin]
[Finished]
darrenderidder commented 10 years ago

You're on iOS? So in a terminal window just type 'which node' and check the full path. Then use that for the command instead of just 'node' in the cmd: part.

sfbayman commented 9 years ago

@darrenderidder your solution worked for me. Thanks.