(node:87907) DeprecationWarning: Using Buffer without `new` will soon stop working. Use `new Buffer()`, or preferably `Buffer.from()`, `Buffer.allocUnsafe()` or `Buffer.alloc()` instead.
Shows up on the standard error every time I use certain command line tools like browserify
and xlsx
. I don't have write access to those node modules and hence can't change the command line scripts. Is there a way to suppress the warning that doesn't involve going back to an older version of node?
There is both --no-deprecation
to silence just deprecation warnings and --no-warnings
to silence _all_ warnings (deprecation or otherwise).
@Fishrock123 @mscdex to be clear, since I currently install the modules globally to be able to use them on the command line, is the suggestion to clone the affected repos and modify the global bin scripts (e.g. https://github.com/substack/node-browserify/blob/master/bin/cmd.js for browserify) so the shebangs have --no-deprecation
, then do some npm install -g on the local modules?
@spelunk Or submit a PR to the offending project to fix the Buffer usage and not have to change anything?
Use
new Buffer()
, or preferablyBuffer.from()
,Buffer.allocUnsafe()
orBuffer.alloc()
instead.
Is there some note regarding when each of these options is appropriate?
thx @mscdex I'll try to push modules to update
Is there a way to do this from env?
(node:7836) DeprecationWarning:
gave any solution for these warning, my node is not able connected with my mongodb server
Most helpful comment
--no-deprecation