Node.js warns that util._extend is deprecated when running Vite or Vue tooling
DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() insteadShort answer
The warning means some package in your toolchain calls util._extend(), which Node.js deprecated; since Node 22 the deprecation is a runtime warning. Find the caller with --trace-deprecation, then update that package. Only use --no-deprecation as a temporary mute, because it hides every deprecation.
Fix it fast
1Find out which cause you have
Run the failing command with deprecation traces on. The stack shows the file in node_modules that calls util._extend.
NODE_OPTIONS=--trace-deprecation npm run dev2Match what you see, then jump to its fix
What does the error look like?
DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() insteadDEP0060
Cause 1 of 2
An old dependency or plugin still calls util._extend
1Check
The Node.js deprecation list calls util._extend an unmaintained legacy API that was exposed by accident, with a runtime deprecation since v22.0.0. Find who depends on the package named in the trace.
npm ls <package-from-the-trace>2Fix
Upgrade the parent package to a version that no longer calls it, or replace the plugin. In your own code use Object.assign.
// before
util._extend(target, source)
// after
target = Object.assign(target, source)3Verify
Start the command again with the trace flag: no DEP0060 line appears.
NODE_OPTIONS=--trace-deprecation npm run devConfirmed by nodejs.org
Cause 2 of 2
The warning is harmless for now and you need a quiet log
1Check
--no-deprecation silences deprecation warnings, --trace-deprecation prints stack traces, and --throw-deprecation turns them into errors. All three are allowed in NODE_OPTIONS.
echo $NODE_OPTIONS2Fix
Mute it only for that script until the package is updated. Remember it hides every deprecation, not only DEP0060.
// package.json
"scripts": {
"dev": "NODE_OPTIONS=--no-deprecation vite"
}3Verify
npm run dev starts without the warning.
npm run devConfirmed by nodejs.org
How do I stop it coming back?
- Update build plugins and dev-server packages regularly, so legacy calls disappear.
- Run CI once with --throw-deprecation on a branch to see what Node will break later.
- Do not leave --no-deprecation in a shell profile; set it per script.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
Web apps
tsconfig rejects allowImportingTsExtensions
An error that allowImportingTsExtensions needs noEmit or emitDeclarationOnly
allowImportingTsExtensions lets files import each other with .ts or .tsx extensions, and TypeScript only allows it together with noEmit or emitDeclarationOnly.
2 causes, each with a fixWeb apps
Apollo Server rejects a request as a potential CSRF
HTTP 400 Bad Request from the GraphQL endpoint
Apollo Server's CSRF prevention is on by default.
3 causes, each with a fixWeb apps
React shows Attempted import error when importing a component or function
Attempted import error:
The build found the file but not the name you asked for.
2 causes, each with a fixWeb apps
AxiosError Network Error with code ERR_NETWORK in a React app
Network Error
ERR_NETWORK means the request produced no readable response.
4 causes, each with a fixWeb apps
Axios get works with a URL string but ignores the object passed as the second argument
The server log shows a GET with no query string
axios.get takes a URL and an optional config object.
3 causes, each with a fixWeb apps
Can't resolve '../axios' in a React project
Module not found: Error: Can't resolve '../axios'
A path that starts with ./ or ../ is a file path, not the axios package.
3 causes, each with a fix