Skip to content

npm#

npm 是在本地机器上快速开始使用 n8n 的方法。你必须先安装 Node.js。n8n 要求 Node.js 版本在 20.19 到 24.x 之间(含边界)。

🌐 npm is a quick way to get started with n8n on your local machine. You must have Node.js installed. n8n requires a Node.js version between 20.19 and 24.x, inclusive.

Stable and Beta versions

n8n releases a new minor version most weeks. The stable version is for production use. beta is the most recent release. The beta version may be unstable. To report issues, use the forum.

Current stable: 2.4.7 Current beta: 2.6.2

尝试使用 npx 和 n8n(Try n8n with npx)#

你可以使用 npx 试用 n8n,无需安装。

🌐 You can try n8n without installing it using npx.

从终端运行:

🌐 From the terminal, run:

1
npx n8n

此命令将下载启动 n8n 所需的所有内容。然后,你可以通过打开 http://localhost:5678 来访问 n8n 并开始构建工作流。

🌐 This command will download everything that's needed to start n8n. You can then access n8n and start building workflows by opening http://localhost:5678.

使用 npm 全局安装(Install globally with npm)#

要全局安装 n8n,请使用 npm:

🌐 To install n8n globally, use npm:

1
npm install n8n -g

要安装或更新到 n8n 的特定版本,请使用 @ 语法来指定版本。例如:

🌐 To install or update to a specific version of n8n use the @ syntax to specify the version. For example:

1
npm install -g n8n@0.126.1

要安装 next

🌐 To install next:

1
npm install -g n8n@next

安装完成后,运行以下命令启动 n8n:

🌐 After the installation, start n8n by running:

1
2
3
n8n
# or
n8n start

下一步步骤(Next steps)#

通过快速入门试用 n8n。

🌐 Try out n8n using the Quickstarts.

正在更新(Updating)#

要将你的 n8n 实例更新到 latest 版本,请运行:

🌐 To update your n8n instance to the latest version, run:

1
npm update -g n8n

要安装 next 版本:

🌐 To install the next version:

1
npm install -g n8n@next

n8n with tunnel#

Danger

Use this for local development and testing. It isn't safe to use it in production.

To use webhooks for trigger nodes of external services like GitHub, n8n has to be reachable from the web. n8n runs a tunnel service that can redirect requests from n8n's servers to your local n8n instance.

通过运行 --tunnel 启动 n8n:

🌐 Start n8n with --tunnel by running:

1
n8n start --tunnel

回滚升级(Reverting an upgrade)#

安装你想要回滚到的旧版本。

🌐 Install the older version that you want to go back to.

如果升级涉及数据库迁移:

🌐 If the upgrade involved a database migration:

  1. 请查看功能文档和发行说明,了解是否需要进行任何手动更改。
  2. 在当前版本上运行 n8n db:revert 来回滚数据库。如果你想回退多个数据库迁移,需要重复此过程。

Windows 故障排除(Windows troubleshooting)#

如果你在 Windows 上运行 n8n 时遇到问题,请确保你的 Node.js 环境已正确设置。请按照微软的指南 在 Windows 上安装 NodeJS

🌐 If you are experiencing issues running n8n on Windows, make sure your Node.js environment is correctly set up. Follow Microsoft's guide to Install NodeJS on Windows.