Closed aml2326 closed 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
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
$(function(){ // Line 4, Pos 1
$(function(){ // Line 4, Pos 11
$(function(){ // Line 4, Pos 13
$(function(){ // Line 4, Pos 13
$(function(){ // Line 4, Pos 14
CORE.ShowHide.showText='more'; // Line 6, Pos 5
CORE.ShowHide.showText='more'; // Line 6, Pos 5
CORE.ShowHide.showText='more'; // Line 6, Pos 27
CORE.ShowHide.showText='more'; // Line 6, Pos 28
CORE.ShowHide.hideText='less'; // Line 7, Pos 27
CORE.ShowHide.hideText='less'; // Line 7, Pos 28
CORE.Overlay.maskColor='#444'; // Line 8, Pos 27
CORE.Overlay.maskColor='#444'; // Line 8, Pos 28
CORE.Overlay.maskOpacity=0.90; // Line 9, Pos 29
CORE.Overlay.maskOpacity=0.90; // Line 9, Pos 30
inField.init(); // Line 13, Pos 5
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.
Thanks for taking the time to look into this for me, I really appreciate it. I look forward to having jslint working again!
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
What happens when you type 'which node' ?
Adam-Leders-MacBook-Pro:Package Control Adam Leder$ which node /usr/local/bin/node
For shits and giggles I download ST3 beta and tried it there with the same error.
Can you provide the contents of your JSLint.sublime-build please. User preferences > package settings > jslint > advanced build settings to view.
{ "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" }
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?
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?
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.
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
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 .
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
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...
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" }
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 .
I downloaded the package and ran the installer. http://nodejs.org/dist/v0.10.1/node-v0.10.1.pkg
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
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 :)
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.
janraasch's fix moves the node command into user settings. So the node command can be set to match your local system.
I've updated my node path & fixed for me too. Thanks for the support :o)
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]
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.
@darrenderidder your solution worked for me. Thanks.
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!