> ## Documentation Index
> Fetch the complete documentation index at: https://nvd-54.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 安装 LangChain

安装 LangChain 包：

<CodeGroup>
  ```bash npm theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  npm install langchain @langchain/core
  # 需要 Node.js 20+
  ```

  ```bash pnpm theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  pnpm add langchain @langchain/core
  # 需要 Node.js 20+
  ```

  ```bash yarn theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  yarn add langchain @langchain/core
  # 需要 Node.js 20+
  ```

  ```bash bun theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  bun add langchain @langchain/core
  # 需要 Bun v1.0.0+
  ```
</CodeGroup>

LangChain 提供了数百个大语言模型(LLM)集成和数千个其他集成。这些集成位于独立的 provider 包中。

<CodeGroup>
  ```bash npm theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  # 安装 OpenAI 集成
  npm install @langchain/openai
  # 安装 Anthropic 集成
  npm install @langchain/anthropic
  ```

  ```bash pnpm theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  # 安装 OpenAI 集成
  pnpm install @langchain/openai
  # 安装 Anthropic 集成
  pnpm install @langchain/anthropic
  ```

  ```bash yarn theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  # 安装 OpenAI 集成
  yarn add @langchain/openai
  # 安装 Anthropic 集成
  yarn add @langchain/anthropic
  ```

  ```bash bun theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
  # 安装 OpenAI 集成
  bun add @langchain/openai
  # 安装 Anthropic 集成
  bun add @langchain/anthropic
  ```
</CodeGroup>

<Tip>
  查看[集成选项卡](/oss/javascript/integrations/providers/overview)了解所有可用集成的完整列表。
</Tip>

安装 LangChain 后，您可以按照[快速入门指南](/oss/javascript/langchain/quickstart)开始使用。

<Tip>
  设置 [LangSmith](https://smith.langchain.com?utm_source=docs\&utm_medium=cta\&utm_campaign=langsmith-signup\&utm_content=oss-langchain-install) 追踪来调试您的第一个 LangChain 应用。按照[追踪快速入门](/langsmith/trace-with-langchain)开始。
</Tip>

***

<div className="source-links">
  <Callout icon="terminal-2">
    [将这些文档连接到](/use-these-docs) Claude、VSCode 等工具，通过 MCP 获取实时答案。
  </Callout>

  <Callout icon="edit">
    [在 GitHub 上编辑此页面](https://github.com/langchain-ai/docs/edit/main/src/oss/langchain/install.mdx) 或 [提交问题](https://github.com/langchain-ai/docs/issues/new/choose)。
  </Callout>
</div>
