node icon indicating copy to clipboard operation
node copied to clipboard

Can we supress the new experimental warning from the new default require(esm) setting?

Open futuremotiondev opened this issue 4 months ago • 11 comments

What is the problem this feature will solve?

I use NVM for Windows.

  1. I run nvm install 23.0.0
  2. v23.0.0 gets installed.
  3. I then run nvm use 23.0.0
  4. I then run npm install npm@latest -g

The latest npm gets installed, but I also get the following output pollution:

(node:32728) ExperimentalWarning: Support for loading ES Module in require() is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
  1. If I then run npm install svgo -g, I get the same ExperimentalWarning pollution.

Is there any way I can suppress this message by default while still leaving the new default require(esm) setting enabled? I don't want to see this warning every time I install a global package, especially since I am automating things.

This doesn't happen with any node versions prior to 23.0.0.

Appreciate any consideration.

What is the feature you are proposing to solve the problem?

A global configuration setting to suppress this new warning every time I install a global module in v23.0.0:

(node:32728) ExperimentalWarning: Support for loading ES Module in require() is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)

What alternatives have you considered?

Nothing yet.

futuremotiondev avatar Oct 17 '24 06:10 futuremotiondev