gpt4 book ai didi

javascript - 使用 prettier 时出现错误 'No files matching the pattern were found'

转载 作者:行者123 更新时间:2023-12-04 11:23:39 30 4
gpt4 key购买 nike

我找到了如何使用 prettier 格式化代码的答案
这是我所做的

npm i prettier -g
prettier --write \"./**/*.{js,html}\"
遇到错误 [error] No files matching the pattern were found: ""./**/*.{js,html}"".任何想法如何解决?你认为是因为我安装了 prettier全局(在答案中它是本地安装的)?
那么当它被全局安装时,你将如何使用它呢?

最佳答案

建议了解决此问题的一种方法 here : 并且实际上为我工作。注意我在 Windows 机器上,所以不确定它在其他机器上的行为。只需删除表达式(引号)之前和之后的任何内容:

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

关于javascript - 使用 prettier 时出现错误 'No files matching the pattern were found',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63070243/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com