-
Notifications
You must be signed in to change notification settings - Fork 16
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
Dependency upgrade: Minimum supported node version v18 #345
Conversation
This project's package.json engines field declared support all the way back to node 10, but we've taken dependencies that are incompatible with anything older than node 18! After updating the engines field, I did some digging and realized that native nodeJS fetch landed in v18, so we have an opportunity here to formalize our support boundary as node 18 and throw out the several fetch implementations we had lying around (one of which was responsible for the punycode deprecation warnings). Also includes a .nvmrc to pin to v18 so we don't accidentally include libraries that require v19+ in the future. Previous error installing on node v17: > yarn install error [email protected]: The engine "node" is incompatible with this module. Expected version "^14.17.0 || ^16.13.0 || >=18.0.0". Got "17.9.1" error Found incompatible module. Previous error running on node v17: > ./bin/run eval "Database.all()" › Error: fetch is not defined:
145a0d2
to
7b71874
Compare
827a303
to
5ee34df
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably consider doing a major version bump when this goes out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You will also likely need to update the pipeline as it runs tests against node 16
Done! |
Ticket(s): FE-5645
Problem
Deprecation errors on every usage of the CLI
Solution
This project's package.json engines field declared support all the way back to node 10, but we've taken dependencies that are incompatible with anything older than node 18! After updating the engines field, I did some digging and realized that native nodeJS fetch landed in v18, so we have an opportunity here to formalize our support boundary as node 18 and throw out the several fetch implementations we had lying around (one of which was responsible for the punycode deprecation warnings).
Also includes a .nvmrc to pin to v18 so we don't accidentally include libraries that require v19+ in the future.
Result
Change Details
duplex: "half"
attribute RequestInit: duplex option is required when sending a body nodejs/node#46221nock
required upgrade to support native fetch interceptors Node 18+: makenock
work nativefetch
nock/nock#2397 (comment)@oclif/test
required upgrade to get rid of the oldernock
dependencyjest
forexpect
https://jest-archive-august-2023.netlify.app/docs/28.x/upgrading-to-jest28/#expect@oclif/core
now exported as a module, moved out ofrequire
where necessaryrequire
outside of thecatch
inbin/run
as that fixed an issue where uncaught errors from OCLIF were having their entire stack trace printed.Testing
As we don't have 100% coverage, I went through and did some light manual testing for the following commands