JavaScript track: npm install can resolve an incompatible @langchain/core, even though the committed lockfile is fine
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 76/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- javascript
- 領域
- build-system
研究方向
從 starter-project 和 solution 中的 package.json、已提交的 package-lock.json,以及練習中關於安裝相依性的說明開始。先在 starter-project 中執行全新的 npm install 進行重現,然後執行 npx tsx src/basicAgent.ts 以確認失敗。兩套練習設定都使用相容的相依性樹狀結構,且進入點能在沒有 package export error 的情況下執行,即代表完成。
由索引模型根據 Issue 內容生成。
描述
Summary
package.json (both starter-project and solution) pins:
json "@langchain/core": "1.1.39", "@langchain/langgraph": "1.2.8",
The committed package-lock.json resolves @langchain/langgraph-checkpoint (a transitive dependency of @langchain/langgraph) to 1.0.1, which is compatible with @langchain/core@1.1.39. So the lockfile itself is internally consistent.
The problem: the exercises instruct learners to run npm install, not npm ci. npm install can re-resolve transitive dependencies against whatever's currently newest on the npm registry rather than strictly honoring the lockfile. @langchain/langgraph-checkpoint has since published newer versions (currently 1.1.3) that require @langchain/core: ^1.1.48 — incompatible with the exact 1.1.39 pin. A fresh npm install today resolves to this newer, incompatible version.
Effect
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './utils/uuid' is not defined by "exports" in .../node_modules/@langchain/core/package.json imported from .../@langchain/langgraph/node_modules/@langchain/langgraph-checkpoint/dist/id.js
thrown immediately on npx tsx src/basicAgent.ts (or any entry point importing @langchain/langgraph), since @langchain/core@1.1.39 doesn't yet expose the ./utils/uuid export subpath that the newer langgraph-checkpoint@1.1.3 needs.
Suggested fix
Either:
- Bump the pinned
@langchain/coreversion inpackage.jsonto something satisfying^1.1.48(e.g.1.1.49or later), removing the fragility of the exact pin against a moving transitive dependency, or - Have learners run
npm ciinstead ofnpm installin the exercise instructions, so the exact working dependency tree from the committed lockfile is used rather than a fresh, potentially-drifted resolution (tradeoff: learners then don't get any newer patch versions of pinned packages).
Option 1 is more robust long-term, since this kind of drift will keep recurring as the npm ecosystem publishes new versions over time, regardless of the lockfile.
Environment
Reproduced on a personal SAP AI Core tenant, JavaScript/TypeScript track, npm install run fresh in starter-project/ (not npm ci), Node.js v24.18.0.
- 主要語言
- Python
- 星號
- 54
- 分支
- 36
- PR 合併指標
- 30 天內沒有已合併 PR
貢獻指南
這個儲存庫沒有索引到貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
SAP-samples/codejam-code-based-agents 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
-
難度 1/5 1 小時以內 新手友好度 88/100
-
難度 2/5 1-3 小時 新手友好度 78/100
SAP-samples/codejam-code-based-agents#35 · 1 則留言 ·
-
難度 2/5 1-3 小時 新手友好度 84/100
-
難度 3/5 1-2 天 新手友好度 65/100
查看 SAP-samples/codejam-code-based-agents 的全部 Issue
相似的 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 86/100
zostera/django-bootstrap4#894 ·
-
難度 2/5 1-3 小時 新手友好度 78/100
use-agent-os/agent-os#3276 ·
-
難度 2/5 1-3 小時 新手友好度 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
難度 2/5 1-3 小時 新手友好度 88/100
NousResearch/hermes-agent#117848 ·
-
難度 2/5 1-3 小時 新手友好度 82/100
zilliztech/memsearch#759 ·