Skip to content

Commit 3c64d78

Browse files
authored
chore(core): emit warning for Node.js versions < 18.x (#6247)
1 parent 72db2b5 commit 3c64d78

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

packages/core/src/submodules/client/emitWarningIfUnsupportedVersion.spec.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
describe("emitWarningIfUnsupportedVersion", () => {
22
let emitWarningIfUnsupportedVersion: any;
33
const emitWarning = process.emitWarning;
4-
const supportedVersion = "16.0.0";
4+
const supportedVersion = "18.0.0";
55

66
beforeEach(() => {
77
const module = require("./emitWarningIfUnsupportedVersion");
@@ -14,7 +14,7 @@ describe("emitWarningIfUnsupportedVersion", () => {
1414
process.emitWarning = emitWarning;
1515
});
1616

17-
describe.skip(`emits warning for Node.js <${supportedVersion}`, () => {
17+
describe(`emits warning for Node.js <${supportedVersion}`, () => {
1818
const getPreviousMajorVersion = (major: number) => (major === 0 ? 0 : major - 1);
1919

2020
const getPreviousMinorVersion = ([major, minor]: [number, number]) =>
@@ -38,12 +38,12 @@ describe("emitWarningIfUnsupportedVersion", () => {
3838
expect(process.emitWarning).toHaveBeenCalledTimes(1);
3939
expect(process.emitWarning).toHaveBeenCalledWith(
4040
`NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will
41-
no longer support Node.js 14.x on May 1, 2024.
41+
no longer support Node.js 16.x on January 6, 2025.
4242
4343
To continue receiving updates to AWS services, bug fixes, and security
44-
updates please upgrade to an active Node.js LTS version.
44+
updates please upgrade to a supported Node.js LTS version.
4545
46-
More information can be found at: https://a.co/dzr2AJd`
46+
More information can be found at: https://a.co/74kJMmI`
4747
);
4848

4949
// Verify that the warning emits only once.

packages/core/src/submodules/client/emitWarningIfUnsupportedVersion.ts

+8-9
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,16 @@ let warningEmitted = false;
1010
* @param version - The Node.js version string.
1111
*/
1212
export const emitWarningIfUnsupportedVersion = (version: string) => {
13-
if (version && !warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 16) {
13+
if (version && !warningEmitted && parseInt(version.substring(1, version.indexOf("."))) < 18) {
1414
warningEmitted = true;
15-
// ToDo: Turn back warning for future Node.js version deprecation
16-
// process.emitWarning(
17-
// `NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will
18-
// no longer support Node.js 14.x on May 1, 2024.
15+
process.emitWarning(
16+
`NodeDeprecationWarning: The AWS SDK for JavaScript (v3) will
17+
no longer support Node.js 16.x on January 6, 2025.
1918
20-
// To continue receiving updates to AWS services, bug fixes, and security
21-
// updates please upgrade to an active Node.js LTS version.
19+
To continue receiving updates to AWS services, bug fixes, and security
20+
updates please upgrade to a supported Node.js LTS version.
2221
23-
// More information can be found at: https://a.co/dzr2AJd`
24-
// );
22+
More information can be found at: https://a.co/74kJMmI`
23+
);
2524
}
2625
};

0 commit comments

Comments
 (0)