#How to resolve node_modules?

1 messages · Page 1 of 1 (latest)

ocean plaza
#

For some reason bun does not work at my end. I have tried it on Linux and Windows.
I have the following package.json:

{
  "scripts": {
    "aitas": "bun run ./src/script.ts"
  },
  "dependencies": {
    "openai": "^4.29.2",
  },
  "exports": {
    ".": {
      "require": "./src/script.ts",
      "import": "./src/script.ts"
    }
  }
}

And I get the following Error:

error: Cannot find module "openai/resources" from "/home/user/project/src/script.ts"
livid plover
#

This error is occurring because openai/resources is not found, which is not related to the package.json above

#

I suggest looking at the package.json of openai

#

In other words if you require or import openai/resources from a different file it will very likely produce the same error

ocean plaza
#

Thanks for your reply! What is causing the issue in detail? I may patch the package to make it compatible for bun.