Hi, Is it truth, that I cannot use openai package on Meoter2 because old nodejs and missing node:stream/web package?
I’m getting following error:
W20240802-20:40:49.772(2)? (STDERR) Error [ERR_UNKNOWN_BUILTIN_MODULE] [ERR_UNKNOWN_BUILTIN_MODULE]: No such built-in module: node:stream/web
W20240802-20:40:49.772(2)? (STDERR) at new NodeError (internal/errors.js:322:7)
W20240802-20:40:49.773(2)? (STDERR) at Function.Module._load (internal/modules/cjs/loader.js:783:13)
W20240802-20:40:49.773(2)? (STDERR) at Module.require (internal/modules/cjs/loader.js:1005:19)
W20240802-20:40:49.774(2)? (STDERR) at require (internal/modules/cjs/helpers.js:107:18)
You can’t use the latest version, which is why Meteor 3.0 expand possibilities in the Node ecosystem of packages. This is happening in many packages and tools, and it will increase over time. Migrating to Meteor 3.0 is becoming essential.
You can use and fix an older supported version in your app. For instance, I use “openai”: “^4.20.0” in a Meteor 2 project. Other newer versions might be compatible as well, but this one is working for me.
Test this version, but be aware the API and features may have changed slightly, though it should still provide a sufficient OpenAI experience.
…little sad, I read on github some issues with Meteor3 and I’m still waiting to stable version before refactor code and migrate. My app is quite big and needs a lot of work and time to rewrite. I was thinking to use another way, Integrate Kafka and create microservice, but I don’t know why, I’m unable to install Meteor in Docker, because, I’m getting error Access Denied, while downloading the package.
But have you tried a previous OpenAI version compatible with Node 14 to get unblocked? Or do you need a specific feature only available on newer versions?
I’m getting this error too, suddenly as of two days ago, and I use Meteor 2.16 and OpenAI npm package. I plan to update to Meteor 3 but will give it a few more point releases before migrating.
Strangely it only happens when trying to deploy, not in development, which makes testing a working versions of an npm package tricky. Why does the problem only happen in the production build process but not locally?
I also don’t understand how the same version of the openai npm package (4.52.2) suddenly stops building if nothing has changed.
Oh, it hit me, in trying to fix this, I updated my package.json to "openai": "^4.20.0" which likely still installs up to 4.54.0 (the current version) in the production build thus introducing the change? Same goes for my current "^4.52.2". So probably the latest version introduced this?
The carot ^ notation doesn’t install the latest version and cause the issue for you?
Will test this and report back this evening.
EDIT: Locking to “openai”: “4.20.0”, and ensuring it was also set in npm-shrinkwrap.json, solved the issue in the production build.
My LLM package works on Meteor 2. It has many advantages over the OpenAI one, mainly that it’s not automatically generated garbage. https://www.npmjs.com/package/poon-llm
Also as a quick update, you can see the error in development if you make sure to install the latest openai npm package then delete and re-install node_modules. The error happens both in development mode and when passing --production.
I can’t find the link to the GitHub Repository for poon-llm in NPM, can you share it? I would like to audit it. Edit: Nevermind, the code tab should suffice
Hello, the problem is caused by a new version of a formdata-node used by openai. Temporarily install “openai”: “4.47.1”, delimiting it in your packages.json file.