You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Suppress the node 7 Buffer DeprecationWarning for global scripts #9589
(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?
Reacted by Truong Nguyen, Leo Gallucci, Mohsen Azimi, Cédric Belin, Nick Soggin, Dima Vakatsiienko, Pan Seba, Chris Watson, Carlos Castaño, Gilbert and 5 more
@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?
Activity
Fishrock123 commentedon Nov 13, 2016
--no-deprecationmscdex commentedon Nov 13, 2016
There is both
--no-deprecationto silence just deprecation warnings and--no-warningsto silence all warnings (deprecation or otherwise).spelunk commentedon Nov 13, 2016
@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?mscdex commentedon Nov 13, 2016
@spelunk Or submit a PR to the offending project to fix the Buffer usage and not have to change anything?
spelunk commentedon Nov 13, 2016
Is there some note regarding when each of these options is appropriate?
mscdex commentedon Nov 13, 2016
@spelunk https://nodejs.org/docs/latest/api/buffer.html#buffer_buffer_from_buffer_alloc_and_buffer_allocunsafe
spelunk commentedon Nov 13, 2016
thx @mscdex I'll try to push modules to update
sam-github commentedon Nov 14, 2016
See #9483
kilianc commentedon Aug 16, 2018
Is there a way to do this from env?
naveen1497 commentedon Jan 8, 2019
(node:7836) DeprecationWarning:
naveen1497 commentedon Jan 8, 2019
gave any solution for these warning, my node is not able connected with my mongodb server