-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
CLI behaves differently on Windows (doesn't work) than on Linux #4086
Comments
Does running
work for you? |
@j-f1 Without quotes? |
I think those are the built-in ignores. It doesn’t matter that they’re not quoted since they aren’t parsed by the shell AFAIK. |
@j-f1 no, following output: C:\git\tichu-core>yarn lint
yarn run v1.3.2
$ prettier 'lib\**\*.ts' 'spec\**\*.js' --write && tslint -c tslint.json 'lib/**/*.ts'
[error] No matching files. Patterns tried: 'lib\**\*.ts' 'spec\**\*.js' !**/node_modules/** !./node_modules/**
error Command failed with exit code 2. edit for clarity, tried the command directly instead of editing the package.json: C:\git\tichu-core>prettier 'lib\**\*.ts' 'spec\**\*.js' --write
No matching files. Patterns tried: 'lib\**\*.ts' 'spec\**\*.js' !**/node_modules/** !./node_modules/** |
Single quotes don't identify strings in Windows A common mistake is So, to make You must escape the double quotes in your {
"scripts": {
"format": "prettier --write \"lib/**/*.ts\""
}
} Hope this helps! |
Thank you very much, @MarkTiedemann! |
@sandrosc Can we close this then? |
Perhaps this would be worth documenting over at https://prettier.io/docs/en/cli.html? |
@j-f1 yes, this issue can be closed. Thanks for the help! |
A friend and I found this bug when the prettier command worked on his Mac, but not on my Windows laptop.
If I use the Linux subsystem for Windows prettier works:
The text was updated successfully, but these errors were encountered: