Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting an error 'No files matching the pattern were found' when using prettier

I found this answer how to format code using prettier

Here is what I've done

npm i prettier -g
prettier --write \"./**/*.{js,html}\"

Got an error [error] No files matching the pattern were found: ""./**/*.{js,html}"". any ideas how to fix? do you think it is because I installed the prettier globally (in the answer it is installed locally)?

So how would you use pettier when it is installed globally then?

like image 857
sreginogemoh Avatar asked Jul 24 '20 08:07

sreginogemoh


Video Answer


2 Answers

One solution to this problem was suggested here : and actually worked for me. Notice I am on Windows machine, so am not sure how it will behave on others. Just remove anything before and after the expression (quotes):

prettier --write ./**/*.{js,html}
like image 62
CyberMessiah Avatar answered Oct 31 '22 12:10

CyberMessiah


Probably the quotes are wrong. It should probably be:

prettier --write "./**/*.{js,html}"

without the backslashes.

like image 21
trusktr Avatar answered Oct 31 '22 11:10

trusktr