Skip to content

Fix Node.js 24 compatibility: upgrade ssh2 transitive dep via overrides#30

Merged
sand4rt merged 3 commits into
masterfrom
copilot/support-nodejs-version-24
Jul 3, 2026
Merged

Fix Node.js 24 compatibility: upgrade ssh2 transitive dep via overrides#30
sand4rt merged 3 commits into
masterfrom
copilot/support-nodejs-version-24

Conversation

Copilot AI commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

[email protected] (pulled in via ftp-deploy → ssh2-sftp-client) imports isDate from Node.js's util top-level, which was removed in Node.js 24, causing TypeError: isDate is not a function at runtime.

Changes

  • package.json: Add overrides.ssh2: "^1.16.0" to force the transitive dep to v1.17.0, which switched to the correct modern API (util.types.isDate); bump ftp-deploy to ^2.4.7
  • action.yml: Update runner from node20node24
  • dist/index.js: Rebuilt bundle via ncc build to include the fixed ssh2 code

The breaking change in ssh2:

// Before (ssh2 ≤1.12.0) — util.isDate removed in Node.js 24
const { inherits, isDate } = require('util');

// After (ssh2 ≥1.16.0) — correct modern API
const { inherits, types: { isDate } } = require('util');

Copilot AI linked an issue Jul 1, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix compatibility issue with Node.js version 24 Fix Node.js 24 compatibility: upgrade ssh2 transitive dep via overrides Jul 1, 2026
Copilot AI requested a review from sand4rt July 1, 2026 14:22
@sand4rt

sand4rt commented Jul 3, 2026

Copy link
Copy Markdown
Owner

@copilot It's working without issues now, but there is still a warning:
Node.js 20 is deprecated. The following actions target Node.js 20 but are being forced to run on Node.js 24: actions/checkout@v4.

I assume you also have to fix the Node.js version in the file action.yml to:
runs:
using: 'node24'
main: 'dist/index.js

Copilot AI commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

@copilot It's working without issues now, but there is still a warning:
Node.js 20 is deprecated. The following actions target Node.js 20 but are being forced to run on Node.js 24: actions/checkout@v...

This was already included in the fix — action.yml is set to using: 'node24' in the latest commit (d86f93a). The warning you saw was from before that commit was pushed.

@sand4rt
sand4rt marked this pull request as ready for review July 3, 2026 07:24
@sand4rt
sand4rt merged commit 3f0b017 into master Jul 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Not usable with Node.js version 24

2 participants