Prettier-vscode: Using prettierPath says i'm using an outdated version of prettier but it's [email protected] latest

Created on 12 Nov 2019  ยท  5Comments  ยท  Source: prettier/prettier-vscode

Summary

Your project is configured to use an outdated version of prettier. You may encounter issues. It is recommended you upgrade to the latest version of prettier.

  "prettier.prettierPath": "./node_modules/.bin/prettier"
โฏ ~/work/project/node_modules/.bin/prettier -v
1.19.1
[INFO - 10:19:39 AM] Formatting ~/work/project/frontend/src/containers/EditSiteContainer.js.
[INFO - 10:19:39 AM] Loaded module 'prettier@undefined' from '~/work/project/node_modules/.bin/prettier'.
[ERROR - 10:19:39 AM] Outdated version of prettier installed. Falling back to bundled version of prettier.

Github Repository to Reproduce Issue

Link to a Github repo that can be used to reproduce the issue.

Steps To Reproduce:

  1. Use prettierPath to point to locally installed prettier

Expected result

Since 1.19.1 is the latest version, I expect prettier-vscode to use it

Actual result

Falls back to bundled version of prettier

Additional information

VS Code Version:

1.40.0
86405ea23e3937316009fc27c9361deee66ffbf5
x64

Prettier & Prettier Plugin Version:
```
[email protected]
[email protected]

OS and version:
macOS 10.15.1

locked

Most helpful comment

Try setting the option to "prettier.prettierPath": "./node_modules/prettier" rather than the bin location.

All 5 comments

Try setting the option to "prettier.prettierPath": "./node_modules/prettier" rather than the bin location.

That seems to have worked although the log output is a bit strange. I'm not sure what it means by No path provided, using bundled prettier.

[INFO - 11:24:36 AM] Extension Name: esbenp.prettier-vscode.
[INFO - 11:24:36 AM] Extension Version: 0.0.0.
[INFO - 11:24:36 AM] No path provided, using bundled prettier.
[INFO - 11:24:36 AM] No path provided, using bundled prettier.
[INFO - 11:24:36 AM] Loaded module '[email protected]' from '/Users/user/work/project/node_modules/prettier'.

@esetnik That is by design. That comes from the language registration part that happens before the module is loaded. I'll update the log messages to make that less confusing. Good feedback.

The latest update removes that unnecessary logging.

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Tanmccuin picture Tanmccuin  ยท  3Comments

PetrykowskiM picture PetrykowskiM  ยท  3Comments

GantMan picture GantMan  ยท  3Comments

screendriver picture screendriver  ยท  4Comments

peralmq picture peralmq  ยท  3Comments