Ember 快速入门:将 JS 文件添加到组件时生成错误

Ember Quickstart: Build Error when adding JS file to component

我刚开始使用 Ember。 Ember Quickstart tutorial 的下一步是将 JS 文件添加到组件:

In addition to the template, a component can also have a JavaScript file [...]. Go ahead and create a .js file with the same name and in the same directory as our template (app/components/people-list.js), and paste in the following content:

我这样做了,但现在出现构建错误:

Build Error (broccoli-persistent-filter:TemplateCompiler)

EEXIST: file already exists, symlink '/var/folders/9f/hkp3jgh507ld849g376t8v9c0000gp/T/broccoli-68910fD325sz6drb3/out-131-broccoli_merge_trees_templates/ember-quickstart/templates/components/people-list.js' -> '/var/folders/9f/hkp3jgh507ld849g376t8v9c0000gp/T/broccoli-68910fD325sz6drb3/out-132-broccoli_persistent_filter_template_compiler/ember-quickstart/templates/components/people-list.js'

我该如何摆脱它?

如果我没看错错误消息,您 people-list.hbspeople-list.js 文件都在 app/templates/components 中。在 Ember Octane 中,两个文件都应移动到 app/components,这是一个称为组件模板托管的新功能。

如果这不是问题,您可能只需要重新启动本地 ember 服务器(虽然我在为组件添加新的 js 文件时不必这样做过去。