安装 ZeroGraph 需要以下步骤:
- environmental preparation::
- 安装 Node.js(推荐版本 16+)和 npm/yarn,可通过命令
node -v
cap (a poem)npm -v
Verify the installation. - (可选)全局安装 TypeScript:
npm install -g typescript
,以支持类型检查。
- 安装 Node.js(推荐版本 16+)和 npm/yarn,可通过命令
- Install ZeroGraph::
- 使用 npm:
npm install @u0z/zero-graph
The - or use yarn:
yarn add @u0z/zero-graph
The
- 使用 npm:
- Verify Installation::
- 创建一个 TypeScript 文件(如
test.ts
),导入模块并输出信息:import { Node, Flow } from '@u0z/zero-graph'; console.log("ZeroGraph installed successfully!");
- Compile and run:
tsc test.ts
cap (a poem)node test.js
,若显示成功信息则配置正确。
- 创建一个 TypeScript 文件(如
This answer comes from the articleZeroGraph: a lightweight AI agent programming frameworkThe