-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Prettier is not working anymore #16121
Comments
Hi there @arndwestermann ! Thanks for filing this bug. Does your issue go away if you install |
I have a different issue while updating prettier to the latest version > NX Running global Nx CLI with PNPM may have issues.
Prefer to use "pnpm" (https://pnpm.io/cli/exec) to execute commands in this workspace.
TIP create a shortcut such as: alias pnx="pnpm nx --"
nx format:check
Check for un-formatted files
Run command using --base=[SHA1] (affected by the committed, uncommitted and untracked changes):
--base Base of the current branch (usually main) [string]
or using --base=[SHA1] --head=[SHA2] (affected by the committed changes):
--base Base of the current branch (usually main) [string]
--head Latest commit of the current branch (usually HEAD) [string]
or using:
--files Change the way Nx is calculating the affected command by providing directly
changed files, list of files delimited by commas or spaces [string]
--uncommitted Uncommitted changes [boolean]
--untracked Untracked changes [boolean]
Options:
--help Show help [boolean]
--version Show version number [boolean]
--exclude Exclude certain projects from being processed [string]
--libs-and-apps Format only libraries and applications files. [boolean]
--projects Projects to format (comma/space delimited) [string]
--all Format all projects [boolean]
Find more information and examples at https://nx.dev/nx/format-check
Error: Cannot find module '/Users/sebpalluel/Documents/dev/offline/marketplace/node_modules/prettier/bin-prettier'
at createEsmNotFoundErr (node:internal/modules/cjs/loader:1104:15)
at finalizeEsmResolution (node:internal/modules/cjs/loader:1097:15)
at resolveExports (node:internal/modules/cjs/loader:569:14)
at Module._findPath (node:internal/modules/cjs/loader:643:31)
at Module._resolveFilename (node:internal/modules/cjs/loader:1068:27)
at Function.resolve (/Users/sebpalluel/Documents/dev/offline/marketplace/node_modules/.pnpm/[email protected]/node_modules/v8-compile-cache/v8-compile-cache.js:164:23)
at Object.<anonymous> (/Users/sebpalluel/Documents/dev/offline/marketplace/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected]/node_modules/nx/src/command-line/format/format.js:18:31)
at Module._compile (/Users/sebpalluel/Documents/dev/offline/marketplace/node_modules/.pnpm/[email protected]/node_modules/v8-compile-cache/v8-compile-cache.js:192:30)
at Module._extensions..js (node:internal/modules/cjs/loader:1321:10)
at Module.load (node:internal/modules/cjs/loader:1125:32) {
code: 'MODULE_NOT_FOUND',
path: '/Users/sebpalluel/Documents/dev/offline/marketplace/node_modules/prettier/package.json'
} I'm using the latest version of nx |
I had the same issue updating to prettier |
I have the same issue as @sebpalluel. It would be great if someone from the Nx team could have a look. |
@AgentEnder maybe |
Prettier v3 support is unrelated to the original issue here. Nx should support prettier v3 fully as of latest. If you hit an issue with prettier v3 please open a new issue. I'm going to close this one out since its been a bit derailed from the original discussion and we've not heard back from @arndwestermann . |
I had same issue this week, I downgraded to |
Well i can confirm that i don't have any issue on my end with |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Current Behavior
If I want to format the code with
prettier
I get an error in the output and the code isn't formatted.Expected Behavior
Format the code with
prettier
without an errorGitHub Repo
No response
Steps to Reproduce
npx create-nx-workspace@latest
with an Angular mono repoapp.component.ts
and make any changesprettier
Nx Report
Failure Logs
Additional Information
package.json
The text was updated successfully, but these errors were encountered: