如何解决更漂亮的语法错误:使用节点 v14.15.0 等待的意外保留字
我正在使用 prettier + sublime text 3 + 创建 react 应用程序。当我保存我的代码时,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
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。