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

Downgrade npmlog + upgrade gauge to address #623 #624

Merged
merged 7 commits into from
Dec 16, 2021
Merged

Conversation

springmeyer
Copy link
Contributor

This should address #623

  • Still keeps at least ansi-regex@5.0.1 thanks to gauge@3.0.2 release
  • And therefore can maintain node v10 support

TODO:

 - Still keeps at least ansi-regex@5.0.1 thanks to gauge@3.0.2 release
 - And therefore can maintain node v10 support
@wraithgar
Copy link

Why were, before this PR, tests not failing on node v10

I can answer this and save you some time: because this was a pre-emptive drop in support. Nothing in the code was changed that would have broke in node10.

The only thing that would catch something like this would be the --engine-strict flag.

@springmeyer
Copy link
Contributor Author

springmeyer commented Dec 13, 2021

Ah! Thank you for explaining that. I saw the --engine-strict mention in #623, but did not connect the dots on how it was the sole thing that caught this. Thanks.

@springmeyer
Copy link
Contributor Author

Hmm, @wraithgar - I just tried, locally, running

npm install --production --engine-strict

against the master branch (without this PRs fix) and it works without errors:

added 54 packages from 21 contributors and audited 394 packages in 1.684s

3 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

$ npm ls gauge                            
@mapbox/node-pre-gyp@1.0.7 /Users/danespringmeyer/projects/node-pre-gyp
└─┬ npmlog@6.0.0
  └── gauge@4.0.0 

Any idea why that is not erroring? I would assume I'd get a non-zero return code from npm install or npm ci with --engine-strict

@springmeyer
Copy link
Contributor Author

Perhaps I need to add engines to the package.json of node-pre-gyp?

@wraithgar
Copy link

It looks like npm@6 is not checking engines when installing from a package-lock. npm@7 always checks.

@bcoe
Copy link

bcoe commented Dec 13, 2021

🎉 thanks for taking on this work. I know I'm like the only person who runs tests with --engine-strict 😆, and that I can be a squeaky wheel.

Edit: my experience has been, this is good to treat as a breaking change, or you eventually get burned by someone upstream using a new feature, e.g., ESM in the case of having a dep move to Node 12.

@springmeyer
Copy link
Contributor Author

@bcoe - no problem, I'd like to be like you. I'm still struggling however to replicate any kind of error or failure with node v10 (or 8 for that matter) and the master code before this fix. Even with npm@7. Would you be up for providing a PR to this repo's .travis.yml that demonstrates how to detect with --engine-strict the problem you were able to catch with CI? So, a PR that fails and then would pass once this PR is merged in.

@bcoe
Copy link

bcoe commented Dec 13, 2021

@springmeyer this is the approach I've been taking that catches things:

https://github.com/googleapis/nodejs-logging/blob/main/.github/workflows/ci.yaml#L22

@bcoe
Copy link

bcoe commented Dec 14, 2021

@springmeyer I did some local testing too, and a couple things I noticed:

  • you need to be running on the version of Node.js that's minmally supported (the engines strict error only throws for me if I'm running npm i on Node 10).
  • I was initially having problems with the package lock on npm@6 (so, as @wraithgar suggests, npm i npm@7 -g might be smart).

Once I did both these things, I'm getting the following with a local check out of node-pre-gyp:

node-pre-gyp$ npm i -production --engine-strict
npm ERR! code ENOTSUP
npm ERR! notsup Unsupported engine for npmlog@6.0.0: wanted: {"node":"^12.13.0 || ^14.15.0 || >=16"} (current: {"node":"10.24.1","npm":"6.14.15"})
npm ERR! notsup Not compatible with your version of node/npm: npmlog@6.0.0
npm ERR! notsup Not compatible with your version of node/npm: npmlog@6.0.0
npm ERR! notsup Required: {"node":"^12.13.0 || ^14.15.0 || >=16"}
npm ERR! notsup Actual:   {"npm":"6.14.15","node":"10.24.1"}

bcoe
bcoe previously approved these changes Dec 16, 2021
Copy link

@bcoe bcoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for doing this work 😄

@springmeyer
Copy link
Contributor Author

Got it, thank you @bcoe - npm@7 + using node v10 allowed me to replicate (and it caught another incompatible dependency - action-walk).

@springmeyer springmeyer merged commit 6ba0ef5 into master Dec 16, 2021
@springmeyer springmeyer deleted the issue-623 branch December 16, 2021 21:39
@springmeyer
Copy link
Contributor Author

This is now published as @mapbox/node-pre-gyp@1.0.8

@minherz
Copy link

minherz commented Dec 17, 2021

Thanks for this work 👏 it allows us to avoid dropping Node 10 on @google-cloud/profiler

hyj1991 pushed a commit to X-Profiler/node-pre-gyp that referenced this pull request 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 this pull request may close these issues.

4 participants