Not able to resolve external npm packages in prod

I am using an external node package (export-to-csv) for one of my hooks in my Phoenix project. When I run it locally, it works. When I deploy it to heroku, it deploys. However when I run it in prod I get and error. You can mark the path "export-to-csv" as external to exclude it from the bundle, which will remove this error.
I suspect the problem is with esbuild, but I don’t know of any solution.
Tried checking my assets directory, but for some reason I don’t have a package.json file in it. Not sure if that’s right.
Here are the versions of elixir, phoenix, and esbuild

elixir: 1.12
phoenix 1.6.15
esbuild 0.4

Here are the config relating to esbuild:

config :esbuild,
  version: "0.14.29",
  default: [
      ~w(js/app.js --bundle --target=es2017 --outdir=../priv/static/assets --external:/fonts/* --external:/images/*),
    cd: Path.expand("../assets", __DIR__),
    env: %{"NODE_PATH" => Path.expand("../deps", __DIR__)}

Anyone know how to fix this?

Is the node package available when the bundle is created? The default phoenix setup doesn’t include handling of npm packages.