question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Vetur format vue with prettier-eslint failed: "Prettier-Eslint format failed: Cannot find module 'prettier'"

See original GitHub issue
  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ
  • I have tried restarting VS Code or running Vetur: Restart VLS

Info

  • Platform: Win
  • Vetur version: v0.30.2
  • VS Code version: 1.51.1

Problem

format with “prettier-eslint” failed_(:з」∠)_ Vue Language Server output is:

[INFO ] Loaded bundled typescript@4.0.5.
[INFO ] Loaded bundled prettier.
[INFO ] Loaded bundled @starptech/prettyhtml.
[INFO ] Loaded bundled prettier-eslint.
[INFO ] Loaded bundled prettier-tslint.
[INFO ] Loaded bundled stylus-supremacy.
[INFO ] Loaded bundled @prettier/plugin-pug.
Vetur initialized
Prettier-Eslint format failed
[Error - time] Cannot find module 'prettier'
Require stack:
- c:\Users\Administrator\.vscode\extensions\octref.vetur-0.30.2\server\dist\vls.js
- c:\Users\Administrator\.vscode\extensions\octref.vetur-0.30.2\server\dist\vueServerMain.js

Reproducible Case

just install vetur and set config "vetur.format.defaultFormatter.js": "prettier-eslint", and create a simple vue project by vue/cli and then open a vue file and then alt + shift + f then Vue Language Server output appear message show above.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
yoyo930021commented, Nov 26, 2020

When will the new version be released? @yoyo930021

Released v0.30.3

0reactions
yoyo930021commented, Dec 7, 2020

@yoyo930021 v0.30.3 is still partially broken for me.

The Format Document command works again, but it gives different results than prettier + eslint --fix commands?

If you use vetur.useWorkspaceDependencies: true? Please open a new issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vue/TypeScript/ESLint/Prettier/Vetur formatting doesn't work
To get Vue/TypeScript/ESLint/Prettier/Vetur working in VSCode, I followed the following steps: Installed the Vue eslint plugin by running ...
Read more >
How I Resolved Vue.js, VSCode, Vetur, Prettyhtml, and ...
So, when open a .vue file in VS Code and Format Document with Vetur, it uses Prettyhtml by default, which violates prettier ES...
Read more >
Using Prettier and ESLint to automate formatting and fixing ...
Learn how to use ESLint and Prettier together to automatically format and fix JavaScript code in your projects.
Read more >
Vim Setup - Prettier
Vim users can install either vim-prettier, which is Prettier specific, or Neoformat or ALE which are generalized lint/format engines with support for ...
Read more >
[eslint] failed to load config "@vue/prettier" to extend from.
PS C:\Users\Vena\Desktop\meal-prep> npm i @vue/eslint-config-prettier npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found