Open BennyTian opened 7 years ago
are you using nvm
? which OS?
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 ...
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
the above did not seem to work. neither setting the path to null
nor to the path of the globally installed npm package
Did you install it with nvm or yarn? I don't use sublime anymore, I don't know how to debug this
i installed with npm, tried brew as well to see if linking differently. how does one use nvm? that's a node version manager
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?
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