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

#620 is a breaking change #623

Closed
bcoe opened this issue Dec 10, 2021 · 8 comments
Closed

#620 is a breaking change #623

bcoe opened this issue Dec 10, 2021 · 8 comments

Comments

@bcoe
Copy link

bcoe commented Dec 10, 2021

Hello @springmeyer, first off thank you for your open source contributions (we use this library on some of our client libraries at Google, and appreciate your work).


I notice the recent update #620, which upgrades npmlog to address a regex vulnerability. Unfortunately, this is technically a breaking change, because it drops support for Node 10.

I noticed that npmlog isn't used too heavily, would you be open to switching to an alternate logger, e.g., pino?

Edit: reading through the code-base, it seems like swapping out the progress behavior would perhaps be a pain in the neck.

@springmeyer
Copy link
Contributor

@bcoe - thanks for the heads up - that has not been apparent to me. My intention has been to keep node v10 support for the time being (and only drop at a major release).

I've also considered dropping npmlog - it's heavier that likely what is needed. It is used because this project was initially modeled after node-gyp which used npmlog. I'd accept a PR changing the logger, but it would likely (as you say) be a bit painful/tedious due to how many tests depend on the output (and the tests are not particularly well written - what I can say the project is not the most modern).

In the meantime are you looking for a new 1.0.x release that restores node v10 support (somehow)?

@bcoe
Copy link
Author

bcoe commented Dec 10, 2021

In the meantime are you looking for a new 1.0.x release that restores node v10 support (somehow)?

If we could figure out a way, this would be amazing. But it might be challenging because I think the latest ansi-regex forces v12.

I also reached to npm, one option would be perhaps floating a patch for npmlog, if npm is open to it (CC: @wraithgar).


Just an FYI, I moved my CI/CD to using this approach a few months ago:

- run: npm install --production --engine-strict 

It's been a great way to catch when a dependency drops a major node version, before it actually breaks behavior.

@wraithgar
Copy link

I don't know if a patch is possible. If there were semver-compatible updates for ansi-regex that were not vulnerable they would be installed already because npmlog uses ^ as its prefix.

Wide-align moved its support to node12 also when fixing this, which is one of the reasons this can't be fixed in v5 of npmlog.

Long term, moving off of npmlog is probably the best option, though I know that's a tall order and there is a limited amount of time in the universe.

@bcoe
Copy link
Author

bcoe commented Dec 13, 2021

@wraithgar I did a bit of digging:

npm/gauge#140

I believe a patch is possible because ansi-regex fixes the issue in 5.0.1 which still supports Node 10.

@bcoe
Copy link
Author

bcoe commented Dec 13, 2021

@wraithgar I think basically, there would need to be a new gauge release, followed by a patch to npmlog, and then node-pre-gyp could pin to the older npmlog.

Pain in the neck, but allows folks to keep using node-pre-gyp on Node 10 until we can drop it soon, this is good motivation for my team at Google to announce dropping Node 10 ASAP in the new year -- but it would stink for users to do this without warning.

@wraithgar
Copy link

you should be able to pin back to v3.0.2 and be node v10 compatible again

@springmeyer
Copy link
Contributor

Thanks @wraithgar - started a PR to pull in downgraded npmlog + gauge at #624.

bcoe added a commit to bcoe/node-pre-gyp that referenced this issue Dec 13, 2021
springmeyer added a commit that referenced this issue Dec 16, 2021
Downgrade npmlog + upgrade gauge to address #623
@springmeyer
Copy link
Contributor

Thanks all! Closed by #624

hyj1991 pushed a commit to X-Profiler/node-pre-gyp that referenced this issue Jun 16, 2023
Downgrade npmlog + upgrade gauge to address mapbox#623
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

Successfully merging a pull request may close this issue.

3 participants