Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need help regarding upgrading from v1.4.1 to v2.1.2 #309

Closed
xeoshow opened this issue Jul 26, 2024 · 2 comments
Closed

Need help regarding upgrading from v1.4.1 to v2.1.2 #309

xeoshow opened this issue Jul 26, 2024 · 2 comments
Labels

Comments

@xeoshow
Copy link

xeoshow commented Jul 26, 2024

Hello,

I am using previous version (v1.4.1) of node-ffprobe-installer, and my node is version 14, works very well.
But recently I have upgraded node-ffprobe-installer to v2.1.2, got problem and can not work.
Just would like to know why changing "require('os')" to "require('node:os')"? My error log shows this is the problem from ...
IMHO, since require('os') works on both old versions and new versions of node, seems require('os') and require('path') are better ways?
Great thanks for help.

https://github.com/SavageCore/node-ffprobe-installer/blob/v2.1.2/index.js

const os = require('node:os');
const process = require('node:process');
......

https://github.com/SavageCore/node-ffprobe-installer/blob/v1.4.1/index.js

const os = require('os');
const path = require('path');
......
@SavageCore
Copy link
Owner

Node v14.18.0 should work

We're on v20.16.0 as LTS, perhaps time to upgrade! ;)

@xeoshow
Copy link
Author

xeoshow commented Jul 27, 2024

Hello @SavageCore ,

Thanks for reply. Actually I have upgraded my node from 14 to 20.12.2, and still the same problem. My latest env is as below:

rockylinux 8.8 64bit
node 20.12.2
npm 10.5.0
pnpm 9.0.2

After investigating, the problem is caused by esm package which I have used in my project:
https://github.com/standard-things/esm
https://www.npmjs.com/package/esm

esm is the world’s most advanced ECMAScript module loader. This fast, production ready, zero dependency loader is all you need to support ECMAScript modules in Node 6+.

esm is widely used (2,581,114 downloads per week now) but seems not that active for years. And "node:XXX" is not supported by esm for now:
standard-things/esm#904

I also checked another similar project:
https://github.com/kribblo/node-ffmpeg-installer/blob/master/index.js

node-ffmpeg-installer has also used the "require('os')" in its latest version, and is also quite popular (329,548 downloads per week):
https://www.npmjs.com/package/@ffmpeg-installer/ffmpeg

I really love node-ffprobe-installer for its convenience, and hopefully it could support more scenarios.
Your any help is highly appreciated!

Best regards, Jason

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants