Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ try these options on npm install to build, if you have problems to install

[`serialport`](https://www.npmjs.com/package/serialport) is an **optional** dependency: npm tries to install it, but if the install fails (or you skip optionals), `modbus-serial` still installs and TCP/UDP usage works.

The version range pulled in by this package targets **serialport 13.x**, which requires **Node.js 20 or newer**. If you need serial on an older Node release, install a compatible `serialport` major (for example 12.x) explicitly alongside `modbus-serial`, or use `--no-optional` and TCP-only flows.

Comment on lines +37 to +38
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

serialport Node.js version compatibility matrix for 12.x and 13.x, and recommended install command for Node 18 and older

💡 Result:

SerialPort Node.js version compatibility matrix for 12.x and 13.x: Node.js 12.x: Last functioning release serialport@10 (unsupported now) Node.js 13.x: Supported by serialport ~8.x (e.g. v8.0.7 fixed Node 13 compile issues; dropped in v11.0.0) Current versions (v13.0.0 as of Dec 2024): Support Active LTS, Maintenance LTS, Current (Node 20,22,24+; dropped Node 18 in v13, Node 16/18 in v13) Recommended install for Node 18 and older: npm install serialport@11 (last supporting Node 18; for older like 12/13 use @10 or @8.x respectively). For Node 18, may need to build from source if no prebuilts or use --unsafe-perm with sudo. General: npm install serialport

Citations:


Specify serialport version in the install command for clarity.

The README mentions installing a "compatible serialport major (for example 12.x)" for older Node releases, but serialport 12.x does not exist as a published release. Based on the compatibility matrix, the correct fallback versions are:

  • Node 18 and older: npm install serialport@11
  • Node 16 and older: npm install serialport@10
  • Node 12–13: npm install serialport@8.x

Consider updating the README snippet to explicitly recommend one of these commands instead of "12.x" to prevent user confusion.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` around lines 37 - 38, Update the README sentence that suggests
"for example 12.x" to list explicit serialport fallback versions and install
commands for clarity: replace the vague "12.x" suggestion with the recommended
mappings and example npm commands (e.g., for Node 18 and older use `npm install
serialport@11`, for Node 16 and older use `npm install serialport@10`, and for
Node 12–13 use `npm install serialport@8.x`) so users have concrete install
instructions; edit the paragraph containing the serialport compatibility note in
README.md accordingly.

**Skip installing optional dependencies** (no native serial build, smaller tree):

npm install modbus-serial --no-optional
Expand Down
Loading
Loading