From cd6086a2b5c2eb8c10276d7636a31e65ba74f8ac Mon Sep 17 00:00:00 2001 From: jerensl <54782057+jerensl@users.noreply.github.com> Date: Tue, 11 Jun 2024 23:08:11 +0800 Subject: [PATCH 1/3] fix(automation-script): rollback node-fetch from v3 to v2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index be135f769d4d..6c0b8e9d1c21 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "moment": "^2.30.1", "next": "14.1.1", "next-mdx-remote": "^4.4.1", - "node-fetch": "^3.3.2", + "node-fetch": "^2.7.0", "postcss": "^8.4.35", "prettier": "^3.3.0", "react": "^18", From a24529e3762be3db81e1235adc61d41d4a56ec34 Mon Sep 17 00:00:00 2001 From: jerensl <54782057+jerensl@users.noreply.github.com> Date: Tue, 11 Jun 2024 23:26:20 +0800 Subject: [PATCH 2/3] fix(automation-script): add two version of node-fetch v3 and v2 --- package.json | 3 ++- scripts/build-newsroom-videos.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 6c0b8e9d1c21..8eb81c847231 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,8 @@ "moment": "^2.30.1", "next": "14.1.1", "next-mdx-remote": "^4.4.1", - "node-fetch": "^2.7.0", + "node-fetch": "^3.3.2", + "node-fetch-2": "npm:node-fetch@^2.7.0", "postcss": "^8.4.35", "prettier": "^3.3.0", "react": "^18", diff --git a/scripts/build-newsroom-videos.js b/scripts/build-newsroom-videos.js index 073a63db9b1d..5de122247104 100644 --- a/scripts/build-newsroom-videos.js +++ b/scripts/build-newsroom-videos.js @@ -1,6 +1,6 @@ const { writeFileSync } = require('fs'); const { resolve } = require('path'); -const fetch = require('node-fetch') +const fetch = require('node-fetch-2') async function buildNewsroomVideos() { try { From 25347e4bd41d13bd3c7de5cbc035df5cd125dadc Mon Sep 17 00:00:00 2001 From: jerensl <54782057+jerensl@users.noreply.github.com> Date: Tue, 11 Jun 2024 23:29:41 +0800 Subject: [PATCH 3/3] fix(automation-script): update lockfile and implement the node-fetch-2 --- package-lock.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/package-lock.json b/package-lock.json index f68acd9be7bf..de68447528e6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -48,6 +48,7 @@ "next": "14.1.1", "next-mdx-remote": "^4.4.1", "node-fetch": "^3.3.2", + "node-fetch-2": "npm:node-fetch@^2.7.0", "postcss": "^8.4.35", "prettier": "^3.3.0", "react": "^18", @@ -11919,6 +11920,26 @@ "url": "https://opencollective.com/node-fetch" } }, + "node_modules/node-fetch-2": { + "name": "node-fetch", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, "node_modules/node-fetch-native": { "version": "1.6.4", "resolved": "https://registry.npmjs.org/node-fetch-native/-/node-fetch-native-1.6.4.tgz",