尝试在 AWS linux EC2 实例中设置 Backstage.io 运行命令 npx @backstage/create-app@latest 后显示错误

问题描述 投票:0回答:1

运行此命令时显示错误@backstage/create-app@latest

  1. JS 堆栈跟踪 --->
  2. 致命错误:达到堆限制分配失败 - JavaScript 堆内存不足
  3. 1: 0xb95be0 节点::Abort() [节点]
  4. 2:0xa9a7f8 [节点]
  5. 3: 0xd6f5b0 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [节点]
  6. 4: 0xd6f957 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [节点]
  7. 5: 0xf4ceb5 [节点]
  8. 6: 0xf5f38d v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [节点]
  9. 7: 0xf39a7e v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [节点]
  10. 8: 0xf3ae47 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [节点]
  11. 9: 0xf1b3c0 v8::internal::Factory::AllocateRaw(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [节点]
  12. 10: 0xf1298c v8::internal::FactoryBase::AllocateRawArray(int, v8::internal::AllocationType) [节点]
  13. 11: 0xf2df1a v8::internal::Handle v8::internal::Factory::CopyArrayAndGrow(v8::internal::Handle, int, v8::internal::AllocationType) [节点]
  14. 12: 0x115c61c v8::internal::JSObject::MigrateToMap(v8::internal::Isolate*, v8::internal::Handle, v8::internal::Handle, int) [节点]
  15. 13: 0x119059e v8::internal::LookupIterator::ApplyTransitionToDataProperty(v8::internal::Handle) [节点]
  16. 14: 0x11a9b7d v8::internal::Object::TransitionAndWriteDataProperty(v8::internal::LookupIterator*, v8::internal::Handle, v8::internal::PropertyAttributes, v8::Maybe, v8::内部::StoreOrigin) [节点]
  17. 15: 0x11c1ea3 v8::internal::Object::AddDataProperty(v8::internal::LookupIterator*, v8::internal::Handle, v8::internal::PropertyAttributes, v8::Maybe, v8::内部::StoreOrigin,v8::内部::EnforceDefineSemantics) [节点]
  18. 16: 0x11c2cf6 v8::internal::Object::SetProperty(v8::internal::LookupIterator*, v8::internal::Handle, v8::internal::StoreOrigin, v8::Maybe) [节点]
  19. 17: 0x12eb105 v8::internal::Runtime::SetObjectProperty(v8::internal::Isolate*, v8::internal::Handle, v8::internal::Handle, v8::internal::Handle ,v8::internal::StoreOrigin,v8::也许)[节点]
  20. 18: 0x115ceb4 v8::internal::JSReceiver::SetOrCopyDataProperties(v8::internal::Isolate*, v8::internal::Handle, v8::internal::Handle, v8::internal::PropertiesEnumerationMode, v8::base::ScopedVector > const*, bool) [节点]
  21. 19: 0x12eef8d v8::internal::Runtime_SetDataProperties(int, unsigned long*, v8::internal::Isolate*) [节点]
  22. 20:0x170e079 [节点]
  23. 纱线安装v1.22.22
  24. [1/5] 正在验证 package.json...
  25. [2/5] 正在解析包...
  26. [3/5] 正在取包裹...
  27. 执行纱线安装✖
  28. 错误:无法执行命令yarn install
  29. 创建应用程序时似乎出了问题🤔
  30. 创建应用程序失败!
  • 尝试在 AWS linux EC2 实例中设置 Backstage.io 运行命令 npx @backstage/create-app@latest 后显示错误

node.js npm yarnpkg portal backstage
1个回答
0
投票

要解决此问题,您可以尝试通过设置 --max-old-space-size 标志来增加 Node.js 可用的内存。具体方法如下:

node --max-old-space-size=4096 /path/to/yarn backstage-cli create-app my-app

/path/to/yarn
替换为纱线可执行文件的实际路径,并将
my-app
替换为您的应用程序的名称。

© www.soinside.com 2019 - 2024. All rights reserved.