This error is related to Windows Line endings being different from Unix ones. Try running npx prettier --write . on your project's directory. This command will tell prettier to fix simple errors (such as this one) when found.
To prevent this error from happening again you can either set "end-of-line" to auto on your .prettierrc file or try setting line endings to "Unix"/LF on your editor: instructions for VSCode and for IntelliJ-based editors
How to get ESLint --fix to also run prettier --write
node.js - prettier command not working even though prettier is in devDependancies - Stack Overflow
A better Prettier CLI and config file
How to add prettier command before code commit or on save file through devdependencies
Videos
This error is related to Windows Line endings being different from Unix ones. Try running npx prettier --write . on your project's directory. This command will tell prettier to fix simple errors (such as this one) when found.
To prevent this error from happening again you can either set "end-of-line" to auto on your .prettierrc file or try setting line endings to "Unix"/LF on your editor: instructions for VSCode and for IntelliJ-based editors
in your .prettierrc file, add this: "endOfLine": "auto"
» npm install prettier-eslint-cli
Installing a module that includes a CLI program like prettier, nodemon, etc., will place the program in node_modules/.bin. Your terminal shell does not know to look in this folder when you run a command. Type echo $PATH in your terminal to see a list of the folders that are checked when you run a command. You'll see that running prettier will be looking in places like /bin, /usr/bin, /usr/local/bin, etc., but definitely not /var/folders/q6/npwl_7xj4wg91lg06f8pnnfh0000gn/T/node_modules.
This is why npx is often used; from their docs:
Executes either from a local node_modules/.bin, or from a central cache, installing any packages needed in order for to run.
You could also run it via ./node_modules/.bin/prettier, or you could install it globally, as you ultimately did, which will put it in a place that is part of your $PATH.
After trying a bunch of things, I noticed it only affected this one folder. So what finally worked was simply cloning the repo again into a different folder.