> ## Documentation Index
> Fetch the complete documentation index at: https://langchain-zh.cn/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 和数千个其他集成组件的连接。这些功能位于独立的提供商包中。

<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) 开始使用。

***

<div className="source-links">
  <Callout icon="edit">
    [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/i18n\zh-CN\oss\langchain\install.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>

  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
  </Callout>
</div>
