设置开发环境(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(Node 版本管理器)在 Linux、Mac 和 WSL(Windows 子系统用于 Linux)上安装两者的说明 here。对于 Windows 用户,请参考微软的指南 在 Windows 上安装 NodeJS。
- n8n 的本地实例。你可以使用
npm install n8n -g安装 n8n,然后按照 在本地运行你的节点 中的步骤测试你的节点。 - 在构建已验证的社区节点时,你必须使用
n8n-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.