Repository navigation
Closed
Labels
area:cliIssues with Prettier's Command Line InterfaceIssues with Prettier's Command Line Interfacelocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.status:needs investigationIssues that need additional investigation, e.g. to understand whether the reported behavior is a bugIssues that need additional investigation, e.g. to understand whether the reported behavior is a bug
Description
Environments:
- Prettier Version: 3.0.0
- Running Prettier via:
yarn prettier - Runtime: Node.js v18.16.1
- Operating System: macOS
- Prettier plugins (if any): none
Steps to reproduce:
# Enable yarn 3:
# https://yarnpkg.com/getting-started/install
corepack enable
corepack prepare yarn@stable --activate
# Create a new project:
yarn init -2
# Install prettier:
yarn add --dev --exact prettier
# Ignore generated files:
cat > .prettierignore << EOL
.yarn/*
.pnp.cjs
yarn.lock
EOL
# Run prettier:
yarn prettier .Expected behavior:
Prettier commands succeed.
Actual behavior:
All prettier commands fail with the following output:
❯ yarn prettier .
node:fs:1615
handleErrorFromBinding(ctx);
^
Error: ENOTDIR: not a directory, stat '/Users/ben/src/prettier-test/.yarn/cache/prettier-npm-3.0.0-7ffbcce680-6a832876a1.zip/node_modules/prettier/internal/cli.mjs'
at statSync (node:fs:1615:3)
at tryStatSync (node:internal/modules/esm/resolve:176:13)
at finalizeResolution (node:internal/modules/esm/resolve:316:17)
at moduleResolve (node:internal/modules/esm/resolve:945:10)
at defaultResolve (node:internal/modules/esm/resolve:1153:11)
at nextResolve (node:internal/modules/esm/loader:163:28)
at ESMLoader.resolve (node:internal/modules/esm/loader:838:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
at ESMLoader.import (node:internal/modules/esm/loader:525:22)
at importModuleDynamically (node:internal/modules/cjs/loader:1188:29) {
errno: -20,
syscall: 'stat',
code: 'ENOTDIR',
path: '/Users/ben/src/prettier-test/.yarn/cache/prettier-npm-3.0.0-7ffbcce680-6a832876a1.zip/node_modules/prettier/internal/cli.mjs'
}
Node.js v18.16.1
Reacted by qb-vajahath, Stereoisomer, Ezra Celli and Yogev Lahyani
Metadata
Metadata
Assignees
Labels
area:cliIssues with Prettier's Command Line InterfaceIssues with Prettier's Command Line Interfacelocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.status:needs investigationIssues that need additional investigation, e.g. to understand whether the reported behavior is a bugIssues that need additional investigation, e.g. to understand whether the reported behavior is a bug
Activity
commscheck commentedon Jul 17, 2023
Confirmed the issue doesn't happen in prettier v2.8.8.
fisker commentedon Jul 17, 2023
It seems you'll have to unplug Prettier.
so1ve commentedon Jul 18, 2023
Maybe add
preferUnpluggedto prettier's package.json will solve this issue?fisker commentedon Jul 18, 2023
Any documation link forFound https://yarnpkg.com/configuration/manifest#preferUnpluggedpreferUnplugged?so1ve commentedon Jul 18, 2023
@fisker Here you are:
https://yarnpkg.com/configuration/manifest#preferUnplugged
evanw/esbuild#2523
Oops you found it 😂
fisker commentedon Jul 18, 2023
Your suggestion make sense.
fisker commentedon Jul 18, 2023
Maybe we can remove this line too
prettier/tests/config/install-prettier.js
Line 68 in 24dfe5a
fisker commentedon Jul 29, 2023
@commscheck I tried your steps to reproduce, but it didn't work on my machine. Can you test #15169 with this install command?
vajahath commentedon Jul 31, 2023
@fisker This works for me. (Ubuntu 22)
fisker commentedon Jul 31, 2023
Thank you!
commscheck commentedon Aug 9, 2023
@fisker working for me too, thanks for the fix!