Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Had to globally install prettier before it worked #27

Closed
aziznal opened this issue Jun 8, 2023 · 5 comments
Closed

Had to globally install prettier before it worked #27

aziznal opened this issue Jun 8, 2023 · 5 comments

Comments

@aziznal
Copy link

aziznal commented Jun 8, 2023

Hello. I installed this plugin and and setup its config like in the readme. I then spent a bunch of time trying to get it to work with no use. I checked my config again and again and again.

In the end, what worked out for me was to install prettier using npm install -g prettier. Was this something obvious that I just missed or should it be added to the plugin docs perhaps? Am I missing something else that caused me to do this?

Thanks for the awesome plugin by the way 🚀

@MunifTanjim
Copy link
Owner

prettier needs to be available in one of these places:

  • In ./node_modules/.bin folder, i.e. you've locally installed prettier for your project
  • Anywhere in the PATH env variable.
    • That means, either you've installed prettier globally
    • Or installed it using something like mason.nvim, that modifies the PATH env variable for Neovim.

This plugin does not install prettier. It only uses the already available prettier on your system/project.

@MunifTanjim
Copy link
Owner

Also, prettier would be pretty slow. It's recommended to use prettierd: https://github.com/fsouza/prettierd

@aziznal
Copy link
Author

aziznal commented Jun 8, 2023

Gotcha. I come from the land of vs code where everything is sort of taken care of in the background which caused me some confusion. Appreciate your help!

@aziznal aziznal closed this as completed Jun 8, 2023
@Devansh-Baghel
Copy link

@MunifTanjim I had the same problem and it got fixed after looking through this issue, it would be really helpful for newcomers if you could pin this issue and/or mention it in the readme.

@MunifTanjim
Copy link
Owner

Added in README.md. Also added warning message if prettier is not found during plugin setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants