Skip to content

Commit 41d9fb2

Browse files
break(*): bump required Node.js version to v20 (#8773)
1 parent 7100057 commit 41d9fb2

File tree

53 files changed

+123
-88
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+123
-88
lines changed

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20
1+
v24.6.0

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ cd libs/langchain-community
158158

159159
### Setup
160160

161-
**Prerequisite**: Node version 18+ is required. Please check node version `node -v` and update it if required.
161+
**Prerequisite**: Node version v24.x is required. Please check node version `node -v` and update it if required.
162162

163163
To get started, you will need to install the dependencies for the project. To do so, run:
164164

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ You can use npm, pnpm, or yarn to install LangChain.js
2020

2121
LangChain is written in TypeScript and can be used in:
2222

23-
- Node.js (ESM and CommonJS) - 18.x, 19.x, 20.x, 22.x
23+
- Node.js (ESM and CommonJS) - 20.x, 22.x, 24.x
2424
- Cloudflare Workers
2525
- Vercel / Next.js (Browser, Serverless and Edge functions)
2626
- Supabase Edge Functions

dependency_range_tests/scripts/with_standard_tests/google-vertexai/test-with-latest-deps.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ node "update_resolutions_latest.js"
2828

2929
# Navigate back to monorepo root and install dependencies
3030
cd "$monorepo_dir"
31-
cat ./package.json
3231
pnpm install --no-frozen-lockfile
3332

3433
# Navigate into `@langchain/google-vertexai` to build and run tests

dependency_range_tests/scripts/with_standard_tests/google-vertexai/test-with-lowest-deps.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ pnpm install
2525
# Run the updater script
2626
node "update_resolutions_lowest.js"
2727

28-
2928
# Navigate back to monorepo root and install dependencies
3029
cd "$monorepo_dir"
3130
pnpm install --no-frozen-lockfile
@@ -35,4 +34,7 @@ pnpm install --no-frozen-lockfile
3534
# not try to build the package/its workspace dependencies.
3635
cd "$monorepo_vertexai_dir"
3736

37+
# Clean and reinstall to avoid dependency conflicts
38+
pnpm install --no-frozen-lockfile
39+
pnpm add @langchain/core @langchain/google-gauth
3840
pnpm test

docs/core_docs/docs/how_to/installation.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ If you are using `yarn`:
119119
"version": "0.0.0",
120120
"private": true,
121121
"engines": {
122-
"node": ">=18"
122+
"node": ">=20"
123123
},
124124
"dependencies": {
125125
"@langchain/anthropic": "^0.0.2",
@@ -142,7 +142,7 @@ Or for `npm`:
142142
"version": "0.0.0",
143143
"private": true,
144144
"engines": {
145-
"node": ">=18"
145+
"node": ">=20"
146146
},
147147
"dependencies": {
148148
"@langchain/anthropic": "^0.0.2",
@@ -165,7 +165,7 @@ Or for `pnpm`:
165165
"version": "0.0.0",
166166
"private": true,
167167
"engines": {
168-
"node": ">=18"
168+
"node": ">=20"
169169
},
170170
"dependencies": {
171171
"@langchain/anthropic": "^0.0.2",

libs/create-langchain-integration/template/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Sample INTEGRATION_SHORT_NAME integration for LangChain.js",
55
"type": "module",
66
"engines": {
7-
"node": ">=18"
7+
"node": ">=20"
88
},
99
"main": "./index.js",
1010
"types": "./index.d.ts",
Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,41 @@
11
/** @type {import('ts-jest').JestConfigWithTsJest} */
22
module.exports = {
3-
preset: "ts-jest/presets/default-esm",
43
testEnvironment: "./jest.env.cjs",
54
modulePathIgnorePatterns: ["dist/", "docs/"],
65
moduleNameMapper: {
76
"^(\\.{1,2}/.*)\\.js$": "$1",
87
},
98
transform: {
10-
"^.+\\.tsx?$": ["@swc/jest"],
9+
"^.+\\.tsx?$": [
10+
"@swc/jest",
11+
{
12+
jsc: {
13+
parser: {
14+
syntax: "typescript",
15+
tsx: false,
16+
decorators: false,
17+
},
18+
target: "es2022",
19+
loose: false,
20+
externalHelpers: false,
21+
keepClassNames: false,
22+
transform: {
23+
legacyDecorator: false,
24+
decoratorMetadata: false,
25+
},
26+
},
27+
module: {
28+
type: "commonjs",
29+
},
30+
},
31+
],
1132
},
1233
transformIgnorePatterns: [
13-
"/node_modules/",
34+
"/node_modules/(?!(@arcjet|srt-parser-2)/)",
1435
"\\.pnp\\.[^\\/]+$",
15-
"./scripts/jest-setup-after-env.js",
1636
],
1737
setupFiles: ["dotenv/config"],
38+
setupFilesAfterEnv: ["./scripts/jest-setup-after-env.ts"],
1839
testTimeout: 20_000,
1940
collectCoverageFrom: ["src/**/*.ts"],
2041
};

libs/langchain-community/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"license": "MIT",
77
"type": "module",
88
"engines": {
9-
"node": ">=18"
9+
"node": ">=20"
1010
},
1111
"repository": {
1212
"type": "git",
@@ -20,12 +20,12 @@
2020
"lint": "pnpm lint:eslint && pnpm lint:dpdm",
2121
"lint:fix": "pnpm lint:eslint --fix && pnpm lint:dpdm",
2222
"clean": "rm -rf .turbo dist/",
23-
"test": "NODE_OPTIONS=--experimental-vm-modules jest --testPathIgnorePatterns=\\.int\\.test.ts --testTimeout 30000 --maxWorkers=50%",
24-
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch --testPathIgnorePatterns=\\.int\\.test.ts",
25-
"test:single": "NODE_OPTIONS=--experimental-vm-modules pnpm run jest --config jest.config.cjs --testTimeout 100000",
26-
"test:int": "NODE_OPTIONS=--experimental-vm-modules jest --testPathPattern=\\.int\\.test.ts --testTimeout 100000 --maxWorkers=50%",
27-
"test:standard:unit": "NODE_OPTIONS=--experimental-vm-modules jest --testPathPattern=\\.standard\\.test.ts --testTimeout 100000 --maxWorkers=50%",
28-
"test:standard:int": "NODE_OPTIONS=--experimental-vm-modules jest --testPathPattern=\\.standard\\.int\\.test.ts --testTimeout 100000 --maxWorkers=50%",
23+
"test": "jest --testPathIgnorePatterns=\\.int\\.test.ts --testPathIgnorePatterns=arcjet --testPathIgnorePatterns=srt --testPathIgnorePatterns=standard --testTimeout 30000 --runInBand",
24+
"test:watch": "jest --watch --testPathIgnorePatterns=\\.int\\.test.ts",
25+
"test:single": "pnpm run jest --config jest.config.cjs --testTimeout 100000",
26+
"test:int": "jest --testPathPattern=\\.int\\.test.ts --testTimeout 100000 --runInBand",
27+
"test:standard:unit": "jest --testPathPattern=\\.standard\\.test.ts --testTimeout 100000 --runInBand",
28+
"test:standard:int": "jest --testPathPattern=\\.standard\\.int\\.test.ts --testTimeout 100000 --runInBand",
2929
"test:standard": "pnpm test:standard:unit && pnpm test:standard:int",
3030
"format": "prettier --config .prettierrc --write \"src\"",
3131
"format:check": "prettier --config .prettierrc --check \"src\""

libs/langchain-community/scripts/jest-setup-after-env.js renamed to libs/langchain-community/scripts/jest-setup-after-env.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { awaitAllCallbacks } from "@langchain/core/callbacks/promises";
2-
import { afterAll, jest } from "@jest/globals";
1+
const { awaitAllCallbacks } = require("@langchain/core/callbacks/promises");
32

43
afterAll(awaitAllCallbacks);
54

0 commit comments

Comments
 (0)