I am getting below error in GitHub CI workflow, but not in my local environment. Why?

Viewed 13
> server@1.0.0 test
> jest --detectOpenHandles

FAIL src/routes/launches/launches.test.js
  ● Test suite failed to run

    Cannot find module 'express' from 'src/app.js'

    Require stack:
      src/app.js
      src/routes/launches/launches.test.js

      1 | const path = require('path');
    > 2 | const express = require('express');
        |                 ^
      3 | const fs = require('fs');
      4 | const cors = require('cors');
      5 | const morgan = require("morgan");

      at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:306:11)
      at Object.<anonymous> (src/app.js:2:17)
      at Object.<anonymous> (src/routes/launches/launches.test.js:2:13)

Test Suites: 1 failed, 1 total
Tests:       0 total
Snapshots:   0 total
Time:        0.694 s
Ran all test suites.
0 Answers
Related