Weird node warning whenever I open terminal
August 29, 2018 3:54 PM   Subscribe

Whenever I open up a new terminal on my High Sierra macbook, I get: (node:69074) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

I understand that this is a Node issue. I'm not a node developer, but some utilities on the computer use it.
Started a couple of months ago, I think.
I have no idea how to begin to debug this.
posted by signal to Computers & Internet (4 answers total)
 
It looks like when your shell starts, it's executing some script that runs on Node. So the way to solve this is to find out what scripts are executing when your shell starts.

If you're using bash (the macOS default), then look for these files in your home directory:
~/.profile
and
~/.bashrc
as well as
/etc/bashrc
to see what programs are being executed when you log in.

If these scripts were added automatically (some programs do this) then they'll likely be ad the bottom of the file and surrounded by comment banners.

But the trick would be to investigate all the commands running in those startup scripts and find out which one is running the out of date node script.
posted by dis_integration at 3:58 PM on August 29, 2018 [5 favorites]


I would move all the .*rc type files mentioned to .*rc-backups and proceed line by line in an opt-in fashion, rather than opt out.

Also keep in mind terminal.app will read files in your home directory but also perhaps in /system or /library or even /usr directories if you have them (or if anything made them and pointed to them for inclusion).
posted by SaltySalticid at 6:17 PM on August 29, 2018


Best answer: If you open a terminal window and run "bash" in it, do you see the same error output? If not, do you see the error output if you run "bash -l"?

If either of those work, add a -x and run it again ("bash -x" or "bash -lx"). This will make the shell print out everything it does while it's doing it, and tracing through all the output on startup should show you what's being executed to cause the error. Most of the output will be useless, but with any luck there will be an obvious contender (in the lines prefixed with + signs) somewhere shortly before the errors are displayed.
posted by russm at 11:19 PM on August 29, 2018 [2 favorites]


Response by poster: Thanks so much, running bash -x showed me the error happened just after "yarn global bin", which led me to upgrading yarn (with "brew upgrade yarn") and that fixed it.
posted by signal at 4:52 AM on August 30, 2018 [1 favorite]


« Older More like Kermode?   |   What should I do about my iphone being stolen? Newer »
This thread is closed to new comments.