[DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
Current Behavior
When using Node 22.x, some nx commands that use the run-many option show this warning. Ex: nx run-many -t serve. Running the same command against a specific app does not show the warning. Ex: nx serve app.
(node:77945) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Documentation on the warning: https://nodejs.org/docs/latest-v22.x/api/deprecations.html#DEP0060
Expected Behavior
nx commands that result in forked processes should be able to be run without warnings.
GitHub Repo
No response
Steps to Reproduce
- Use any version of Node 22.x.
- Use any recent version of nx with a simple Fastify server.
- Start up a server using
nx run-many -t serve - Observe the displayed deprecation warning.
Nx Report
NX Report complete - copy this into the issue template
Node : 22.4.1
OS : linux-arm64
npm : 10.8.1
nx : 19.4.2
@nx/js : 19.4.2
@nx/jest : 19.4.2
@nx/linter : 19.4.2
@nx/eslint : 19.4.2
@nx/workspace : 19.4.2
@nx/devkit : 19.4.2
@nx/esbuild : 19.4.2
@nx/eslint-plugin : 19.4.2
@nx/node : 19.4.2
@nrwl/tao : 19.4.2
typescript : 5.5.3
---------------------------------------
Registered Plugins:
@nx/eslint/plugin
@nx/jest/plugin
Failure Logs
No response
Package Manager Version
No response
Operating System
- [ ] macOS
- [ ] Linux
- [ ] Windows
- [ ] Other (Please specify)
Additional Information
Running node --trace-warnings node_modules/.bin/nx run-many -t serve to trace out the source of the warning shows this:
(node:74883) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
at Logger (/project/node_modules/strong-log-transformer/lib/logger.js:32:18)
at /project/node_modules/nx/src/tasks-runner/forked-process-task-runner.js:219:39
at new Promise (<anonymous>)
at ForkedProcessTaskRunner.forkProcessWithPrefixAndNotTTY (/project/node_modules/nx/src/tasks-runner/forked-process-task-runner.js:181:16)
at ForkedProcessTaskRunner.forkProcess (/project/node_modules/nx/src/tasks-runner/forked-process-task-runner.js:119:25)
at TaskOrchestrator.runTaskInForkedProcess (/project/node_modules/nx/src/tasks-runner/task-orchestrator.js:286:54)
at TaskOrchestrator.applyFromCacheOrRunTask (/project/node_modules/nx/src/tasks-runner/task-orchestrator.js:269:61)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async TaskOrchestrator.executeNextBatchOfTasksUsingTaskSchedule (/project/node_modules/nx/src/tasks-runner/task-orchestrator.js:77:13)
at async Promise.all (index 0)
The strong-log-transformer dependency is coming from: https://github.com/nrwl/nx/blob/2c4c2ae8ca525b973df97b4d8721709b481ad027/packages/nx/package.json#L65
This appears to be its only usage in nx: https://github.com/nrwl/nx/blob/2c4c2ae8ca525b973df97b4d8721709b481ad027/packages/nx/src/tasks-runner/forked-process-task-runner.ts#L4
Same problem
In newest version still appear... This strong-log-transformer lib is not updated from 2018... but somebody prepared a fix, which waiting to CR...
the same thing happens here
actual for me
(node:59326) [DEP0060] DeprecationWarning: The util._extend API is deprecated. Please use Object.assign() instead.
I have this problem
(node:21492) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Has anybody found a solution?
I had this error. I changed the node version to a lower version and everything worked
as mentioned above, it is caused by https://github.com/strongloop/strong-log-transformer/issues/12. need to wait for strong-log-transformer to update
i submitted a pr to remove package strong-long-transfromer from nx's package's dependencies
My node version 22.2 reported this error, I reduced the node version to 18.20 and started again to solve the problem.Should be too high version caused by incompatibility?
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.