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

Installed Prettier extension does not format and gives following error: Cannot find module 'prettier' #3376

Open
ldco2016 opened this issue Apr 21, 2024 · 1 comment

Comments

@ldco2016
Copy link

No description provided.

@ssbarnea
Copy link

That is clearly a bug report of very questionable quality, but I have to say that is real. I often get an error about not having prettier installed.

["INFO" - 14:26:54] Attempted to determine module path from /Users/ssbarnea/c/a/ansible-compat
["ERROR" - 14:26:54] Failed to load module. If you have prettier or plugins referenced in package.json, ensure you have run `npm install`
["ERROR" - 14:26:54] Cannot find module 'prettier' from '/Users/ssbarnea/c/a/ansible-compat'
Error: Cannot find module 'prettier' from '/Users/ssbarnea/c/a/ansible-compat'
	at e.exports [as sync] (/Users/ssbarnea/.vscode/extensions/esbenp.prettier-vscode-1

I use multi-root workspaces, that is for sure and only some of these projects have a package.json in them with prettier, the others do not. Still, I do have prettier installed globally via npm install -g prettier, so I see no reason why the prettier vscode extension would fail to find a prettier.

I do suspect that this might be a newer regression, no more than 1-2 months old as I do not remember seeing it before.

$ which -a prettier
/Users/ssbarnea/.asdf/shims/prettier
/opt/homebrew/bin/prettier

ssbarnea@m1: ~/c/a/molecule chore/contraints
$ prettier --version
3.2.5

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

2 participants