piuccio / sublime-esformatter

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

It looks like esformatter is not installed. Please make sure that it is installed globally or in project node_modules folder #75

Open BennyTian opened 7 years ago

BennyTian commented 7 years ago

installed esformater : npm install -g esformatter

execute command: esformatter --help

result: `Usage: esformatter [options] [files...]

Options: -v, --version Display the current version. -h, --help Display help and usage details. -c, --config Path to custom configuration file. -p, --preset Set style guide preset ("jquery", "default"). --plugins Comma separated list of plugins. -i Edit input files in place; use with care! --diff Check code style and output char diff. --diff-unified Check code style and output unified diff. --no-color Remove colors from diff (default if terminal doesn't support colors). --color Force colored diffs even if terminal doesn't support it.`

but sublime text(3) alert:

It looks like esformatter is not installed. Please make sure that it is installed globally or in project node_modules folder

piuccio commented 7 years ago

are you using nvm? which OS?

BennyTian commented 7 years ago

macos 10.12.3
npm 3.3.12 node v5.3.0 Python 2.7.10

node installed with tar.gz . and confing NODE_HOME ...

piuccio commented 7 years ago

Python 2.7 means Sublime2, I believe this plugin might work better in Sublime3.

Anyway, in both cases you can try setting the esformatter_path in the config

"esformatter_path": null,

point it to your global installation of esformatter, it might do the trick

maikelmclauflin commented 6 years ago

the above did not seem to work. neither setting the path to null nor to the path of the globally installed npm package

piuccio commented 6 years ago

Did you install it with nvm or yarn? I don't use sublime anymore, I don't know how to debug this

maikelmclauflin commented 6 years ago

i installed with npm, tried brew as well to see if linking differently. how does one use nvm? that's a node version manager

piuccio commented 6 years ago

I had a quick look at the code, the plugin tries to run node esformatter --version to verify that the command works. First it tries to use a local version, so you might try npm install esformatter in your project and reset your config.

It also relies on node to work, so you might want to check your PATH variable.

In any case, both this plugin and esformatter are kinda inactive (last commit on esformatter is more than 1 year ago). You might have better luck with prettier maybe?