1

I'm working on another machine today. I've pulled my code from GIT and can see the project source files. But when running npm start I get the following error:

Error: Cannot find module './dist'
Require stack:
- C:\project\code\server\index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:973:15)
    at Function.Module._load (internal/modules/cjs/loader.js:855:27)
    at Module.require (internal/modules/cjs/loader.js:1033:19)
    at Module.newFunc (C:\project\code\server\node_modules\appmetrics\lib\aspect.js:101:26)
    at Module.newFunc (C:\project\code\server\node_modules\ibmapm-embed\appmetrics-zipkin\lib\aspect.js:101:26)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (C:\project\code\server\index.js:5:21)
    at Module._compile (internal/modules/cjs/loader.js:1144:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1164:10)
    at Module.load (internal/modules/cjs/loader.js:993:32)

Looking in index.js I can see const application = require('./dist'); but that folder doesn't exist.

I've tried npm run build and it spits out the following to the terminal:

> convid-eo@1.0.0 build C:\project\code\server
> lb-tsc

But no dist folder is created.

I've looked in the Loopback 4 documentation, but can't find any info. Are there any gurus around that can help out?

John Tiggernaught
  • 758
  • 1
  • 6
  • 25

1 Answers1

5

You can fix it by running npm run clean and then npm run build.

Diana
  • 311
  • 1
  • 3
  • Yep, that was it. I also just discovered there is a `tsconfig.tsbuildinfo` file found in the project root. If I manually delete this file could use `npm run build`. It seems like `npm run clean` deletes this file during it's process. – John Tiggernaught May 20 '20 at 15:56