question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error building new application - npx @backstage/create-app

See original GitHub issue

I have followed the steps in create-an-app when I have tried the command npx @backstage/create-app the process has stopped trying yarn tsc.

Expected Behavior

The command finished correctly

Current Behavior

npx @backstage/create-app

 Building the app:
  executing     yarn install ✔
  executing     yarn tsc ◠
<--- Last few GCs --->
oc[14013:0x634a6c0]    17317 ms: Mark-sweep (reduce) 484.5 (486.9) -> 483.6 (487.9) MB, 600.7 / 0.0 ms  (+ 0.0 ms in 16 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 604 ms) (average mu = 0.089, current mu = 0.005) alloc[14013:0x634a6c0]    18058 ms: Mark-sweep (reduce) 484.6 (486.9) -> 483.8 (487.9) MB, 716.1 / 0.0 ms  (+ 0.1 ms in 15 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 741 ms) (average mu = 0.060, current mu = 0.034) alloc

<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0xa389b0 node::Abort() [/usr/bin/node]
 2: 0x96e0af node::FatalError(char const*, char const*) [/usr/bin/node]
 3: 0xbb7a4e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/bin/node]
 4: 0xbb7dc7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/bin/node]
 5: 0xd73fd5  [/usr/bin/node]
 6: 0xd74b5f  [/usr/bin/node]
 7: 0xd8299b v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/bin/node]
 8: 0xd8655c v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/bin/node]
 9: 0xd54c3b v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/usr/bin/node]
10: 0x109d21f v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/usr/bin/node]
11: 0x1446379  [/usr/bin/node]
Aborted (core dumped)
error Command failed with exit code 134.
yarn run v1.22.17
$ tsc
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
  executing     yarn tsc ✖

Error: Could not execute command yarn tsc

It seems that something went wrong when creating the app 🤔

🔥  Failed to create app!

Possible Solution

I wish I knew it

Steps to Reproduce

  1. npx @backstage/create-app
  2. wait
  3. Get the error

Context

I have an AWS t2.micro server with a PostgreSQL DB included. Could the server not have enough memory?

Your Environment

yarn backstage-cli info
yarn run v1.22.17
$ /home/ubuntu/poseidon-app/node_modules/.bin/backstage-cli info
OS:   Linux 5.11.0-1023-aws - linux/x64
node: v14.18.2
yarn: 1.22.17
cli:  0.10.5 (installed)

Dependencies:
  @backstage/app-defaults                                  0.1.3
  @backstage/backend-common                                0.10.2
  @backstage/backend-tasks                                 0.1.2
  @backstage/catalog-client                                0.5.3
  @backstage/catalog-model                                 0.9.8
  @backstage/cli-common                                    0.1.6
  @backstage/cli                                           0.10.5
  @backstage/config-loader                                 0.9.1
  @backstage/config                                        0.1.11
  @backstage/core-app-api                                  0.3.1
  @backstage/core-components                               0.8.3
  @backstage/core-plugin-api                               0.4.1
  @backstage/errors                                        0.1.5
  @backstage/integration-react                             0.1.17
  @backstage/integration                                   0.7.0
  @backstage/plugin-api-docs                               0.6.21
  @backstage/plugin-app-backend                            0.3.21
  @backstage/plugin-auth-backend                           0.6.1
  @backstage/plugin-catalog-backend                        0.19.4
  @backstage/plugin-catalog-import                         0.7.8
  @backstage/plugin-catalog-react                          0.6.10
  @backstage/plugin-catalog                                0.7.7
  @backstage/plugin-github-actions                         0.4.30
  @backstage/plugin-org                                    0.3.33
  @backstage/plugin-permission-common                      0.3.0
  @backstage/plugin-permission-react                       0.2.1
  @backstage/plugin-proxy-backend                          0.2.15
  @backstage/plugin-scaffolder-backend-module-cookiecutter 0.1.7
  @backstage/plugin-scaffolder-backend                     0.15.19
  @backstage/plugin-scaffolder-common                      0.1.2
  @backstage/plugin-scaffolder                             0.11.17
  @backstage/plugin-search-backend-node                    0.4.3
  @backstage/plugin-search-backend                         0.3.0
  @backstage/plugin-search                                 0.5.4
  @backstage/plugin-tech-radar                             0.5.1
  @backstage/plugin-techdocs-backend                       0.12.2
  @backstage/plugin-techdocs                               0.12.13
  @backstage/plugin-user-settings                          0.3.15
  @backstage/search-common                                 0.2.1
  @backstage/techdocs-common                               0.11.2
  @backstage/test-utils                                    0.2.1
  @backstage/theme                                         0.2.14
  @backstage/types                                         0.1.1
  @backstage/version-bridge                                0.1.1
Done in 0.78s.
  • Browser Information: NA

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Rugvipcommented, Jan 9, 2022

Yep, a t2.micro instance does indeed not have enough memory to build the project, but that’s fine, because it should be enough to run it. The @backstage/create-app command is something that you’ll want to run on your local dev machine to create a new Backstage project. Within that project you can the build and upload artifacts to for running on your instance.

The getting started docs have more information on how to get things set up. When it comes time to deploy then the docker deployment docs walk you throw some options, or if you prefer to run without docker you’ll want to have a closer look at the backstage-cli backend:bundle command

1reaction
OrkoHuntercommented, Jan 9, 2022

@rcruz63 Hi! The issue is certainly due to the memory limit. t2.micro instances have a maximum of 1GB memory. Hence setting the max node memory via NODE_OPTIONS to 4GB is ineffective since the maximum memory the instance can get is < 1GB. Could you try this on a larger instance e.g. t2.medium which has 4GB of memory?

I am sorry I’m not exactly sure how much memory create-app needs 😬

Read more comments on GitHub >

github_iconTop Results From Across the Web

@backstage/create-app - npm
This package provides a CLI for creating a copy of the Backstage app. You can use the flag --skip-install to skip the install....
Read more >
Create an App · Backstage Software Catalog and Developer ...
Backstage provides a utility for creating new apps. It guides you through the initial setup of selecting the name of the app and...
Read more >
Setting up Techdocs on Backstage | Let's Treat Docs Like Code
You can read more about their docs-as-code story in this article. In this post we will walk you through how to setup Backstage...
Read more >
npx create-react-app err_socket_timeout - You.com | The AI ...
It appears npx installs all peer dependencies. Do all of the included @backstage/* packages really need to be included as peer dependencies? Can...
Read more >
Ubuntu create-react-app fails with permission denied
By running create-react-app you are executing the command as user and create-react-app is trying to modify something in the ~/.npm/ directory ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found