在尝试运行本地开发实例时,我在运行 bin/ember-cli -u 后收到此消息:
bin/ember-cli -u
- building... Build Error (TemplateCompiler) in raw-templates/badge-selector-autocomplete.hbr ENOENT: no such file or directory, open '/tmp/broccoli-155704EZeLMQlFLy1Y/out-0004-template_compiler/raw-templates/badge-selector-autocomplete.js
我可能在本地弄坏了东西,但这以前从未发生过。
它期望一个 js 文件与 hbr 文件一起出现?!为什么会这样做?
好的,已解决!
我曾被告知 16.x 已过时,因此我尝试使用最新版本的 Node(20.x)。
当我切换回 lts/hydrogen (18.x) 时,它又可以正常构建了。
显然,Node 20.x 还没有(对我来说!)起作用。
经验教训。
很高兴知道这一点。我一直看到这个警告但忽略了它:
警告:Ember CLI v5.0.0 未在 Node v20.10.0 上进行测试。请参阅“https://github.com/ember-cli/ember-cli/blob/master/docs/node-support.md”以了解哪个 Node 版本最适合使用。
我需要 Node v20.10.0 来运行我本地机器上同时运行的另一个应用程序。安装 NVM 似乎解决了这个问题:
v20.10.0
~/discourse$ nvm use 18.18.2
是的,nvm 在 WSL2 上的使用比 n 简单得多,后者存在各种权限问题……
nvm
n
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.