设置开发环境#
¥Set up your development environment
本文档列出了开发节点所需的基本依赖,以及有关设置编辑器的指南。
¥This document lists the essential dependencies for developing a node, as well as guidance on setting up your editor.
要求#
¥Requirements
要构建和测试节点,你需要:
¥To build and test a node, you need:
- Node.js 和 npm。最低 Node 版本:18.17.0你可以在 此处 中找到有关如何使用 nvm(节点版本管理器)在 Linux、Mac 和 WSL(适用于 Linux 的 Windows 子系统)上安装的说明。Windows 用户请参阅 Microsoft 的 在 Windows 上安装 NodeJS 指南。
¥Node.js and npm. Minimum version Node 18.17.0. You can find instructions on how to install both using nvm (Node Version Manager) for Linux, Mac, and WSL (Windows Subsystem for Linux) here. For Windows users, refer to Microsoft's guide to Install NodeJS on Windows.
- n8n 的本地实例。你可以使用
npm install n8n -g安装 n8n,然后按照 在本地运行节点 中的步骤测试你的节点。
¥A local instance of n8n. You can install n8n with npm install n8n -g, then follow the steps in Run your node locally to test your node.
- 当 构建已验证的社区节点 为真时,你必须使用
n8n-node工具 来创建和测试你的节点。
¥When building verified community nodes, you must use the n8n-node tool to create and test your node.
你还应该安装 git。这使得你可以克隆和使用 n8n-node-starter。
¥You should also have git installed. This allows you to clone and use the n8n-node-starter.
编辑器设置#
¥Editor setup
n8n 建议使用 VS Code 作为你的编辑器。
¥n8n recommends using VS Code as your editor.
安装以下扩展:
¥Install these extensions:
通过使用 VS Code 和这些扩展,你可以在编写代码时访问 n8n 节点代码检查器的警告。
¥By using VS Code and these extensions, you get access to the n8n node linter's warnings as you code.