From 62afd3946fba01bd70ef712ba9e017a2d44a60c8 Mon Sep 17 00:00:00 2001 From: Jerens Lensun <54782057+jerensl@users.noreply.github.com> Date: Thu, 18 Jul 2024 00:23:32 +0800 Subject: [PATCH] fix: add node-fetch v2 for script automation and keep node-fetch v3 (#3038) Co-authored-by: Ansh Goyal %0ACo-authored-by: asyncapi-bot --- package-lock.json | 21 +++++++++++++++++++++ package.json | 1 + scripts/build-newsroom-videos.js | 2 +- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 300e8e8b2c4..738534b90ee 100644 --- a/package-lock.json +++ b/package-lock.json @@ -49,6 +49,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", @@ -24227,6 +24228,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", diff --git a/package.json b/package.json index c9991e6cd9b..4dbbc4d939d 100644 --- a/package.json +++ b/package.json @@ -83,6 +83,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", diff --git a/scripts/build-newsroom-videos.js b/scripts/build-newsroom-videos.js index 073a63db9b1..5de12224710 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 {