title | description | tags | ||||
---|---|---|---|---|---|---|
How to Disable Node.js Experimental Warnings in Terminal |
Learn how to easily suppress Node.js experimental warnings in your terminal using the suppress-experimental-warnings package. Perfect for Nuxt, Next.js, or any Node-based project. |
|
Tired of those noisy ExperimentalWarning
messages cluttering your terminal during development?
Here’s how you can easily suppress them across your scripts using the suppress-experimental-warnings
package.
pnpm add suppress-experimental-warnings -D
Modify your package.json
to inject the suppression automatically into your Node processes by adding this before each command:
NODE_OPTIONS=--require=suppress-experimental-warnings
{
"scripts": {
"dev": "NODE_OPTIONS=--require=suppress-experimental-warnings nuxt dev",
"build": "NODE_OPTIONS=--require=suppress-experimental-warnings nuxt build",
"start": "NODE_OPTIONS=--require=suppress-experimental-warnings nuxt start",
"dev:win": "cross-env NODE_OPTIONS=--require=suppress-experimental-warnings nuxt dev"
}
}
Note:
For Windows compatibility, usecross-env
to set environment variables properly (dev:win
example above).
Now, when you run:
pnpm dev
You should see a clean terminal — no more ExperimentalWarning
spam!