2

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?

barkin
  • 179
  • 2
  • 12

3 Answers3

2

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.

barkin
  • 179
  • 2
  • 12
  • didnt work for me, i tried the things like this --> ` "files.exclude": { "**/.DS_Store": true, "**/.git": true, "**/.hg": true, "**/.svn": true, "**/CVS": true, "dist": false, },` – Sami Ullah Jan 24 '22 at 10:34
  • It worked for me. I was just developing an extension component and linking it with main lb4 app with the help of npm link. When I build the extension folder vscode is hiding dist folder and npm link also not copying dist folder into node_module/linked_extension or package. – Pavan kumar Apr 08 '23 at 08:10
1

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).

Rifa Achrinza
  • 1,555
  • 9
  • 19
0

Just remove tsconfig.tsbuildinfo and relaunch the command

npm run build

Abdoulaye SOW
  • 91
  • 2
  • 2