npm#
npm 是快速在本地计算机上启动 n8n 的方法。你必须安装 Node.js。n8n 需要 Node.js 版本介于 20.19 和 24.x 之间(含 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.
Latest and Next versions
n8n releases a new minor version most weeks. The latest version is for production use. next is the most recent release. You should treat next as a beta: it may be unstable. To report issues, use the forum.
Current latest: 1.122.5
Current next: 1.123.2
尝试使用 npx 和 n8n#
¥Try n8n with npx
你可以使用 npx 试用 n8n,无需安装。
¥You can try n8n without installing it using npx.
从终端运行:
¥From the terminal, run:
1 | |
此命令将下载启动 n8n 所需的一切。然后,你可以访问 n8n 并通过打开 http://localhost:5678 开始构建工作流程。
¥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 | |
要安装或更新到特定版本的 n8n,请使用 @ 语法指定版本。例如:
¥To install or update to a specific version of n8n use the @ syntax to specify the version. For example:
1 | |
安装 next:
¥To install next:
1 | |
安装完成后,运行以下命令启动 n8n:
¥After the installation, start n8n by running:
1 2 3 | |
下一步步骤#
¥Next steps
使用 快速入门 试用 n8n。
¥Try out n8n using the Quickstarts.
正在更新#
¥Updating
要将 n8n 实例更新到 latest 版本,请运行:
¥To update your n8n instance to the latest version, run:
1 | |
安装 next 版本:
¥To install the next version:
1 | |
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 | |
回滚升级#
¥Reverting an upgrade
安装你想要回滚到的旧版本。
¥Install the older version that you want to go back to.
如果升级涉及数据库迁移:
¥If the upgrade involved a database migration:
- 请查看功能文档和发行说明,了解是否需要进行任何手动更改。
¥Check the feature documentation and release notes to see if there are any manual changes you need to make.
2. 在当前版本上运行 n8n db:revert 以回滚数据库。如果你想回滚多个数据库迁移,则需要重复此过程。
¥Run n8n db:revert on your current version to roll back the database. If you want to revert more than one database migration, you need to repeat this process.
Windows 故障排除#
¥Windows troubleshooting
如果你在 Windows 上运行 n8n 时遇到问题,请确保你的 Node.js 环境已正确设置。请遵循 Microsoft 的 在 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.