barkin
barkin

Reputation: 351

Loopback 4 won't generate build files

When I try to build a Loopback 4 application with npm run build on Ubuntu 16.04, npm runs lb-tsc for 3 seconds and then just stops without printing any message. After it stops a tsconfig.tsbuildinfo file is generated but the dist folder is not.

My tsconfig.json is like the following:

{
  "$schema": "http://json.schemastore.org/tsconfig",
  "extends": "@loopback/build/config/tsconfig.common.json",
  "compilerOptions": {
    "outDir": "dist",
    "rootDir": "src"
  },
  "include": ["src"]
}

I also tried running npm run build:watch, npm run clean, and running all of these with sudo and still no luck. Any idea what's causing this?

Upvotes: 2

Views: 2388

Answers (3)

Abdoulaye SOW
Abdoulaye SOW

Reputation: 91

Just remove tsconfig.tsbuildinfo and relaunch the command

npm run build

Upvotes: 0

barkin
barkin

Reputation: 351

Turns out the build files are actually generated but lb4 cli produces settings.json in .vscode folder which configures VS code to exclude the dist folder from project workspace by default.

Upvotes: 2

Rifa Achrinza
Rifa Achrinza

Reputation: 1585

Please try the following debugging steps:

  1. Update to the latest Node.js LTS version (at the time of writing: v12.18.1)

  2. Delete node_modules

  3. Run lb4 update

    ^ Note: This will update the dependencies, which may contain breaking changes. Keep a backup of package.json

  4. Run npm install

  5. Run npm run clean

  6. Run npm start

Be sure to run the commands in the root directory of the project (where package.json is present).

Upvotes: 1

Related Questions