piuccio / sublime-esformatter

JavaScript formatter plugin for Sublime Text
MIT License
28 stars 20 forks source link

Error (1):[Errno 2] No such file or directory: 'esformatter' #67

Closed ghost closed 8 years ago

ghost commented 8 years ago

I receive the following error upon formatting: "Error (1):[Errno 2] No such file or directory: 'esformatter'. "

piuccio commented 8 years ago

is that path in your PATH? can you run esformatter --version from the terminal? Which OS are you using?

ghost commented 8 years ago

is that path in your PATH?

Yes.

can you run esformatter --version from the terminal?

esformatter v0.9.5

Which OS are you using?

OS X 10.11.5

remborg commented 8 years ago

Are you using nvm? I had problems with it, I didn't really need it so I removed it.

ghost commented 8 years ago

No, Node is at /usr/local/bin,

remborg commented 8 years ago

Could you paste here your EsFormatter.sublime-settings ?

ghost commented 8 years ago

EsFormatter.sublime-settings { "format_on_save": false, "esformatter_path": "/Users/cbloodworth/.npm-packages/lib/node_modules/esformatter/bin/esformatter", "esformatter_config_file": ["/Users/cbloodworth/.esformatter"] }

If I change esformatter_path to null, I get "It looks like esformatter is not installed...".

$PATH /Users/cbloodworth/.npm-packages/bin:/opt/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/opt/fzf/bin:/Users/cbloodworth/n/bin

Node version is 6.2.1. I've also tried 6.0.0.

remborg commented 8 years ago

I think you need to keep it to null as you have esformatter installed globally. I'm on ubuntu but maybe the plugin works differently on OS X? The version 2.0.0 of this plugin doesn't handle unix paths (with /). Piuccio merged my PR to fix this.

Maybe you could try to update the package to the version 2.0.1? I don't know if the package manager is already up-to-date so you might have to do it manually.

ghost commented 8 years ago

I just updated. 2.0.1 fixed this :)

ghost commented 8 years ago

I'm afraid this issue has returned. I can't think of anything that has changed, apart from restarting Sublime.

remborg commented 8 years ago

That's strange, can you double check the version of the plug-in installed? Maybe restarting sublime did something to the config... Did you try to restart sublime or maybe delete the cache?

ghost commented 8 years ago

It is strange. I checked and I'm on 2.0.1. I also cleared Sublime's Packages directory and reinstalled everything, as well as restarted Sublime a few times, but the issue persists.

remborg commented 8 years ago

I think there is a few other places in the plugin that need to be changed to support UNIX paths. Maybe you could fix them and submit a PR? This way https://github.com/piuccio/sublime-esformatter/commit/e094749aff59850787029047bca588d31f2a318d

This could fix your problem... I can't reproduce the problem on Linux so I don't know what else you could try apart from this.