AugustinMauroy
Node.js v16 to v18!
This article covers a part of the migration from Node.js v16 to v18. The userland migrations team is working on more codemods to help you with the migration.
This page provides a list of codemods to help you migrate your code from Node.js v16 to v18.
err-invalid-callback
In Node.js v18, the DEP0159 deprecation was introduced, which deprecated the ERR_INVALID_CALLBACK error code in favor of ERR_INVALID_ARG_TYPE. This codemod will help you replace any references to the old error code with the new one.
The source code for this codemod can be found in the err-invalid-callback directory.
You can find this codemod in the Codemod Registry.
npx codemod run @nodejs/err-invalid-callback try {
fs.readFile("file.txt", "invalid-callback");
} catch (err) {
- if (err.code === "ERR_INVALID_CALLBACK") {
+ if (err.code === "ERR_INVALID_ARG_TYPE") {
console.error("Invalid callback provided");
}
}Also handles deduplication when both codes were already checked:
const isCallbackError =
- err.code === "ERR_INVALID_CALLBACK" ||
- err.code === "ERR_INVALID_ARG_TYPE";
+ err.code === "ERR_INVALID_ARG_TYPE";| # | Наименование новости | Тональность | Информативность | Дата публикации |
|---|---|---|---|---|
| 1 | Node.js 24.18.0 (LTS) | 0 | 43.33 | 23-06-2026 |
| 2 | Node.js 24.18.1 (LTS) | 0 | 43.33 | 29-07-2026 |
| 3 | Node.js 24.16.0 (LTS) | 0 | 43.33 | 21-05-2026 |
| 4 | Evolving the Node.js Release Schedule | 0 | 10 | 10-03-2026 |
| 5 | Node.js 24.19.0 (LTS) | 0 | 43.33 | 03-08-2026 |
| 6 | Node.js 24.14.0 (LTS) | 0 | 43.33 | 24-02-2026 |
| 7 | Node.js 25.8.2 (Current) | 0 | 43.33 | 24-03-2026 |
| 8 | Node.js 25.8.1 (Current) | 0 | 43.33 | 11-03-2026 |
| 9 | Node.js 24.17.0 (LTS) | 0 | 43.33 | 18-06-2026 |