Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Errno 2] No such file or directory #8

Closed
aml2326 opened this issue Mar 24, 2013 · 28 comments
Closed

[Errno 2] No such file or directory #8

aml2326 opened this issue Mar 24, 2013 · 28 comments
Assignees

Comments

@aml2326
Copy link

aml2326 commented Mar 24, 2013

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
Copy link
Author

aml2326 commented Mar 24, 2013

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
Copy link
Author

aml2326 commented Mar 25, 2013

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

@ghost ghost assigned darrenderidder Mar 26, 2013
@darrenderidder
Copy link
Collaborator

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
Copy link
Author

aml2326 commented Mar 26, 2013

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

@aml2326
Copy link
Author

aml2326 commented Mar 27, 2013

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
Copy link
Collaborator

What happens when you type 'which node' ?

@aml2326
Copy link
Author

aml2326 commented Mar 27, 2013

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

@aml2326
Copy link
Author

aml2326 commented Mar 27, 2013

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

@darrenderidder
Copy link
Collaborator

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

@aml2326
Copy link
Author

aml2326 commented Mar 27, 2013

{
"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"
],
"file_regex": "^/./([^\/])$",
"line_regex": ".// Line ([0-9]), Pos ([0-9]*)$",
"selector": "source.js, source.css, source.json, source.sass, source.less, source.html"
}

@darrenderidder
Copy link
Collaborator

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
Copy link
Author

aml2326 commented Mar 27, 2013

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
Copy link
Collaborator

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
Copy link
Author

aml2326 commented Mar 27, 2013

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
Copy link
Collaborator

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 [email protected] 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//issues/8#issuecomment-15546390
.

@aml2326
Copy link
Author

aml2326 commented Mar 28, 2013

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
Copy link
Collaborator

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
Copy link
Author

aml2326 commented Mar 28, 2013

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"
],
"file_regex": "^/./([^\/])$",
"line_regex": ".// Line ([0-9]), Pos ([0-9]*)$",
"selector": "source.js, source.css, source.json, source.sass, source.less, source.html"
}

@darrenderidder
Copy link
Collaborator

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 [email protected] 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"
],
"file_regex": "^/./([^\/])$",
"line_regex": ".// 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//issues/8#issuecomment-15586364
.

@aml2326
Copy link
Author

aml2326 commented Mar 28, 2013

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

@mwq27
Copy link

mwq27 commented Mar 29, 2013

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
Copy link

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
Copy link
Collaborator

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
Copy link
Collaborator

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

@cubicmushroom
Copy link

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

@kgibs
Copy link

kgibs commented Apr 23, 2014

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
Copy link
Collaborator

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
Copy link

@darrenderidder your solution worked for me. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants