akalongman / sublimetext-codeformatter

Code Formatter plugin for ST2/ST3
MIT License
773 stars 130 forks source link

[Errno 2] No such file or directory #20

Closed FGRibreau closed 10 years ago

FGRibreau commented 11 years ago

Hello!

I'm trying to format a JavaScript file on Sublime text2 with codeformatter and all I get is:


Format error:
[Errno 2] No such file or directory

Node is installed

$ which node
/Users/fg/.nvm/v0.10.13/bin/node
sjelfull commented 11 years ago

Same here.

MarcoGomesr commented 11 years ago

me too

bcoco commented 11 years ago

ditto

afxjzs commented 11 years ago

again. on php files.

robbinhan commented 11 years ago

me too. on php files

dylan-k commented 11 years ago

I'm seeing this same error, while trying to reformat code for an .html file in Sublime Text 2 for mac.

ifthenelse commented 11 years ago

In Sublime Text 3 for mac I get this:

CodeFormatter Format error: [Errno 2] No such file or directory: 'node'

NodeJS is installed:

$ which node /usr/local/bin/node

Am I missing something?

JMUkikster commented 11 years ago

I'm also getting the same error - Sublime Text 2 on OS X. Anyone have a solution yet?

zanetaylor commented 11 years ago

Me too.

Bechrissed commented 10 years ago

Same problem here, node installed. Anybody has a solution?

$ which node /usr/local/bin/node

akalongman commented 10 years ago

I will fix it

britto commented 10 years ago

I think we could take a flexible approach, like SublimeLinter's.

Bechrissed commented 10 years ago

@akalongman any chance you got to fixing it?

autoferrit commented 10 years ago

Having the issue on OSX, with sublime 3, node is in /usr/local/bin/node (via homebrew)

Is there any way to get around this temporarily?

abecks commented 10 years ago

Having this problem trying to format .HTML files.

pengyan518 commented 10 years ago

i have the same issue in sublime 3

ivopt commented 10 years ago

Semi-solved it...

I was getting the "Format error: [Errno 2] No such file or directory" Then I read the comment of @ifthenelse and it lead me to think "hey, if I made a symlink on /usr/bin/node pointing to /usr/bin/nodejs would it work?" And it does!

So, all I did was: sudo ln -s /usr/bin/nodejs /usr/bin/node

This is a semi-solution... the real solution would be the plugin detecting the correct name for the nodejs command, but at least a got it to work..

phnah commented 10 years ago

same problem ST2 on Mac OS

noducks commented 10 years ago
sudo rm -f /usr/bin/node
sudo ln -s /usr/local/bin/nodejs /usr/bin/node

A variation on LynxEyes' solution. This fixed it for me. Depends where your node is which node

gotroch commented 10 years ago

Thanks LynxEyes, works for me now.

dylan-k commented 10 years ago

I was able to resolve this by creating a symlink to the official nodejs package binary via: sudo ln -s /usr/local/bin/node /usr/bin/node

ReyHaynes commented 10 years ago

Method from @dylan-k works...thanks!

dvdwlsn commented 10 years ago

@dylan-k's isn't working out for me, any ideas?

sudo ln -s /usr/local/bin/node /usr/bin/node
ln: /usr/bin/node: File exists

Node:

node which
/usr/local/bin/node
ts commented 10 years ago

@dwils7 The ln command is complaining about an existing node binary in /usr/bin. Seeing as you have node installed in /usr/local/bin, you're likely safe to sudo rm /usr/bin/node & sudo ln -s /usr/local/bin/node /usr/bin/node

ninek9 commented 10 years ago

I use NVM and symlink worked for me too.

homerjam commented 10 years ago

@dylan-k 's solution worked for me, thanks.

$ which node
/usr/local/bin/node
$ sudo ln -s /usr/local/bin/node /usr/bin/node
7SKY commented 10 years ago

Same issue here, had added the symlink and got it working for html/css but it's not working for php. Also rm and recreated - no luck. Restarted sublime each time... any other ideas... does my directory structure and config file matter at all?

akalongman commented 10 years ago

Fixed. Removed node dependency