0

我正在使用更漂亮的 + 崇高文本 3 + 创建反应应用程序。当我保存代码时,prettier 无法格式化 jsx 并抛出错误 -

/home/timtinan37/react/new-project/node_modules/prettier/third-party.js:9863
      for await (const place of this.config.searchPlaces) {
          ^^^^^

SyntaxError: Unexpected reserved word
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:616:28)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/timtinan37/react/new-project/node_modules/prettier/index.js:16652:18)


Prettier process finished with exit code 1.

当前节点版本: 14.15.0(通过 nvm 安装)

更漂亮的全球 + 本地版本: 2.2.1

4

0 回答 0