SublimeJsPrettier: prettier_cli_path not being picked up

Prettier version 1.1.0

JsPrettier version (package.json) “version”: “1.7.4”,

My Prettier.sublime-settings file looks like:

{
  "prettier_cli_path": "$HOME/.nvm/versions/node/v7.9.0/bin/prettier"
}

(which exists and executes fine)

however when running the installed plugin it get the following in the sublime console

Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 818, in run_
    return self.run(edit)
  File "/Users/callum.rogan/Library/Application Support/Sublime Text 3/Packages/sublime-prettier/prettier.py", line 67, in run
    prettify_code(edit, self.view, region)
  File "/Users/callum.rogan/Library/Application Support/Sublime Text 3/Packages/sublime-prettier/prettier.py", line 45, in prettify_code
    shell=IS_WINDOWS
  File "./python3.3/subprocess.py", line 819, in __init__
  File "./python3.3/subprocess.py", line 1448, in _execute_child
FileNotFoundError: [Errno 2] No such file or directory: 'prettier'

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 24 (4 by maintainers)

Most upvoted comments

@atefBB yeah! great Job!

My problem was that I had installed it with Yarn. Problem solved by:

yarn global remove prettier

And then install it with npm instead:

npm install -g prettier

@tsai-jimmy thx for your help !

@jonlabelle I had tried that also.

I get the exact same issue with my settings file being:

{
  "prettier_cli_path": "/Users/myuser/.nvm/versions/node/v7.9.0/bin/prettier",
  "node_path": "/Users/myuser/.nvm/versions/node/v7.9.0/bin/node"
}