gajus / lightship

Abstracts readiness, liveness and startup checks and graceful shutdown of Node.js services running in Kubernetes.
Other
518 stars 32 forks source link

http-terminator: Please verify that the package.json has a valid "main" entry. #39

Closed fmoessle closed 3 years ago

fmoessle commented 3 years ago

Node version: v14.17.0 Lightship version: 6.7.2 OS: macOS 11.5.2

import { createLightship } from 'lightship'

const lightship = createLightship()

Running my application throws this error:

[ERROR] 19:03:22 Error: Cannot find module '/Users/project/node_modules/http-terminator/dist/src/index.js'. 
Please verify that the package.json has a valid "main" entry

Maybe the error comes from the last update in http-terminator 3.0.1: https://github.com/gajus/http-terminator/releases/tag/v3.0.1

fmoessle commented 3 years ago

Fixing the sub-dependency in package.json temporarily solves the issue:

{
  "dependencies": {
    "lightship": "6.7.2"
  },
  "resolutions": {
    "http-terminator": "3.0.0"
  }
}
fmoessle commented 3 years ago

Solved with http-terminator 3.0.3.