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

node:fs breaks --update-db on earlier node versions #35

Open
lharrison1313 opened this issue May 1, 2024 · 5 comments
Open

node:fs breaks --update-db on earlier node versions #35

lharrison1313 opened this issue May 1, 2024 · 5 comments

Comments

@lharrison1313
Copy link

lharrison1313 commented May 1, 2024

When running the below command on node version 14.16.0 we get the following error:

Command: npx browserslist@latest --update-db
Error:

Cannot find module 'node:fs'
Require stack:
/root/.npm/_npx/178/lib/node_modules/browserslist/node_modules/update-browserslist-db/index.js
/root/.npm/_npx/178/lib/node_modules/browserslist/cli.js

@ai
I believe this commit 2b56d5c switched the imports for all node libraries to the require(node:fs) format which may have broken it for older node versions. Could you potentially switch it back to the original form require(fs)?

@lharrison1313 lharrison1313 changed the title node:fs breaks node:fs breaks update on earlier node versions May 1, 2024
@lharrison1313 lharrison1313 changed the title node:fs breaks update on earlier node versions node:fs breaks --update-db on earlier node versions May 1, 2024
@ai
Copy link
Member

ai commented May 1, 2024

Node.js is note officially supported by Node.js team for a long time.

And we officially do not support it.

Do you have any reason why we should support it?

@alegalviz
Copy link

Same here, for now version 14.21.3 of node works fine, but yes, we should move to v18 based on https://endoflife.date/nodejs

Thank you!!

@MisaoDev
Copy link

This change is breaking some legacy pipelines that rely on browserslist and the --update-db option.

Is there any way to install an older version with npx?

Running npx update-browserslist-db@1.0.13 throws an error saying you should update npm or use npx browserslist@ --update-db, but that command always uses the latest update-db.

@ai
Copy link
Member

ai commented May 14, 2024

I released 1.0.16 without node: but I really disappointment in the community. If you have legacy system and need help from somebody for supporting it, you need to pay for that work.

We have Open Collective, but I do not see your all there:
https://opencollective.com/browserslist

@MisaoDev
Copy link

I released 1.0.16 without node: but I really disappointment in the community. If you have legacy system and need help from somebody for supporting it, you need to pay for that work.

We have Open Collective, but I do not see your all there: https://opencollective.com/browserslist

I'm sorry I wasn't expecting a fix, or legacy code to be supported. But rather pointing out that legacy code was unable to opt-out of the latest updates to update-db, due to the way both packages force you to use the latest version.

It is kinda odd that the package would enforce downloading from @latest though. I think as long as people are unable to run browserslist with an older version of update-db, you'll keep running into legacy projects breaking, as they can't stay with older versions. But maybe there is a way I'm not seeing and that's why I was asking.

Either way I'm sorry for being unable to collaborate but thank you for the fix.

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

No branches or pull requests

4 participants