首页 > 解决方案 > 在启动 ember 服务器时,我收到了类似 SyntaxError: Unexpected identifier async postBuild() 之类的错误

问题描述

启动 ember 服务器时出现此错误 此错误的原因可能是什么?

Unexpected identifier
/Users/chraju/Desktop/sites/blog-front-end/node_modules/ember-cli-typescript/js/addon.js:47
    async postBuild() {
          ^^^^^^^^^

SyntaxError: Unexpected identifier
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:549:28)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/chraju/Desktop/sites/blog-front-end/node_modules/ember-cli-typescript/index.js:9:20)



标签: ember.js

解决方案


更新节点

非虚拟机安装 8.11.1

使用更新版本

非虚拟机使用 8.11.1

在 package.json 更新 ember-cli 版本

“ember-cli”:“2.13.3”

删除节点模块并运行

rm -rf 节点模块

npm 安装

余烬

现在工作正常


推荐阅读