Balena cli on windows debian givesDeprecationWarning: OutgoingMessage.prototype._headers is deprecated n

I have just installed Debian on Windows Services for Linux. I am a bit new to balena and npm on node.js.

npm i balena-cli

every execution of balena-cli returns
(node:13149) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated

npm audit returns 0 vulnerabilities.

a more detailed debug is

TLS 13293: client _init handle? true
NET 13293: pipe false null
NET 13293: connect: find host
NET 13293: connect: dns options { family: undefined, hints: 32 }
HTTP 13293: sockets 1
HTTP 13293: write ret = false
HTTP 13293: outgoing message end.
(node:13293) Warning: Setting the NODE_DEBUG environment variable to ‘http’ can expose sensitive data (such as passwords, tokens and authentication headers) in the resulting log.
TLS 13293: client initRead handle? true buffered? false
NET 13293: _read
NET 13293: _read wait for connection
(node:13293) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
NET 13293: afterConnect
TLS 13293: client _start handle? true connecting? false requestOCSP? false
NET 13293: _read
NET 13293: Socket._read readStart
TLS 13293: client emit session
TLS 13293: client onhandshakedone
TLS 13293: client _finishInit handle? true alpn false servername
TLS 13293: client emit secureConnect. authorized: true
HTTP 13293: AGENT incoming response!

Hey @gman,

What version of Node.js do you have installed? Could it be that Debian is shipping a very old Node.js version? I’d suggest to use at least v8 (the current stable is v10 and v8 is deprecated atm but still good enough for most cases)

Thanks - I am new to this node, npm etc. so learning a bit every time

which balena /home/kevin/.nvm/versions/node/v12.5.0/bin/balena node --version

hey @gman, I think your node version is actually too new! We only build and test balena-cli against v8 and v10 of node. If instead of installing via npm you install the standalone package then you shouldn’t have any problems as that comes with a bundled node. The instructions for this installation are at

getting the null error now
balena --version

balena login

I DONT GET null, but normal execution, when I run sudo balena, but the correct information

Hi @gman

What happens if you run the CLI in debug mode?

DEBUG=1 balena login


DEBUG=1 balena login Debug: original argv0="balena" argv=[/home/kevin/bin/balena-cli/balena,/snapshot/balena-

below is a diff of
sudo strace -e trace=file bin/balena-cli/balena > /mnt/c/cache/balfilesudo.strace 2>&1 strace -e trace=file bin/balena-cli/balena > /mnt/c/cache/balfile.strace 2>&1

Can you check the permissions on ~/.balena? I’m guessing it was created, and can only be read by, root.

Just to add a bit more on this, you can either sudo chown <yourUserName> ~/.balena Alternatively if you don’t mind logging in again on the cli, you can just delete the ~/.balena directory, and it will be re-created on the next run of the cli.

Ok that was it, initially .balena is not a dir but a file.

usergm@DESKTOP-7G3OCBP:~ ls -latr ~/.balena -rw-rw-rw- 1 usergm usergm 30 Jun 27 14:58 /home/usergm/.balena usergm@DESKTOP-7G3OCBP:~ cat .balena

I deleted it and on next run without sudo .balena came back as a directory.

usergm@DESKTOP-7G3OCBP:~ rm .balena usergm@DESKTOP-7G3OCBP:~ ls -altr | grep bal
drwxrwxrwx 1 usergm usergm 512 Jul 5 07:46 .balena

I hope this was helpful, but I guess it was the mix up of apt install and custom that got messed up together. I am now running OK… Thanks for all.