Pi-Hole Project - Need Noobie Help Please


I’m working from a Macintosh. I’m starting the Pi-Hole project and am at the ‘balena login’ command step. Typing this command does not work and returns a ‘command not found’ message. Reviewing the documentation is one ‘rabbit warren’ after another. I did get the node.js and npm working as requested, but that seems to do nothing. I’m not sure where to go next. I’m making noobie errors I’m sure, but this is not a 15 minute project as advertised.

Any help would be appreciated - I’m stymied. Thanks


Hi @richbpark,

Sounds like you couldn’t install balena CLI as the balena command is not found. Just to be sure, which steps do you follow to install balena CLI?

In our docs we provide alternative options of installations:

As you mention npm, I guess you follow our first suggestion:
npm install balena-cli -g --production --unsafe-perm

Did you get an error running this command? If so, what is it? Then which OSX version are you using?

If this is not working, you could follow the steps under Standalone install section of the above link to install balena CLI. Once the installation is done, I hope the rest of tutorial flows without any issues : )


Thank you for the reply.

My Mac OS is v10.13.6. I did attempt the options from https://www.balena.io/docs/reference/cli/ but understanding the initial dependencies and translating the linux command ‘apt-get’ don’t seem to work on the Mac at all. I tried the:

npm install balena-cli -g --production --unsafe-perm

and the following errors were returned:

richpark@RBP-iMac-Quad-Core:~/Projects $ sudo apt-get install g++ make python git --yes


sudo: apt-get: command not found

richpark@RBP-iMac-Quad-Core:~/Projects $ npm install balena-cli -g --production --unsafe-perm

npm WARN deprecated graceful-fs@3.0.11: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js

npm WARN deprecated natives@1.1.6: This module relies on Node.js’s internals and will break at some point. Do not use it, and update to graceful-fs@4.x.

npm WARN deprecated graceful-fs@1.2.3: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules

npm WARN balena-request@10.0.1 requires a peer of balena-auth@^2.0.0 but none is installed. You must install peer dependencies yourself.

npm WARN resin-register-device@5.0.0 requires a peer of resin-request@^9.0.2 but none is installed. You must install peer dependencies yourself.

npm ERR! path /usr/local/lib/node_modules

npm ERR! code EACCES

npm ERR! errno -13

npm ERR! syscall access

npm ERR! Error: EACCES: permission denied, access ‘/usr/local/lib/node_modules’

npm ERR! { [Error: EACCES: permission denied, access ‘/usr/local/lib/node_modules’]

npm ERR! stack:

npm ERR! ‘Error: EACCES: permission denied, access ‘/usr/local/lib/node_modules’’,

npm ERR! errno: -13,

npm ERR! code: ‘EACCES’,

npm ERR! syscall: ‘access’,

npm ERR! path: ‘/usr/local/lib/node_modules’ }

npm ERR!

npm ERR! The operation was rejected by your operating system.

npm ERR! It is likely you do not have the permissions to access this file as the current user

npm ERR!

npm ERR! If you believe this might be a permissions issue, please double-check the

npm ERR! permissions of the file and its containing directories, or try running

npm ERR! the command again as root/Administrator (though this is not recommended).

npm ERR! A complete log of this run can be found in:

npm ERR! /Users/richpark/.npm/_logs/2019-04-04T04_34_03_159Z-debug.log

richpark@RBP-iMac-Quad-Core:~/Projects $ su


su: Sorry

Yes, the the balena cli does not install. What I’m looking for is an installer that installs what is necessary for the Mac OS and the tutorial all seem to require many prerequisites.

Are there tutorials that simply explain the end-to-end process for different OS’s? A terminal program should not be this difficult and what is provided may be technically correct is of little use for a newcomer to the balena system. I successfully completed the getting started project with little difficultly and assumed my Macintosh and RPi3B+ were sufficient for the other projects. The documentation is not at a newcomer level.

Any specific assistance would be appreciated.

Balena Etcher is the best program for burning RPi SD’s. Thank you.


First of all thanks for the feedback. I agree that we could make the balena-cli installation easier. Actually we are working on releasing a native installer so it becomes straightforward to do the installation. I also forwarded your docs feedback to my team here.

For now, could you please do the standalone installation?

Coming back to your issue. Seems like the issue goes beyond balena-cli installation. npm has this doc that explains how to resolve such permission issues:

So alternatively, you could first re-install npm as instructed on this link and then retry installing balena-cli.

(You don’t need to run that line with apt-get. It’s for installing dependencies in Linux Debian.)


Thank you - I’ll try the stand-alone, but noticed it has its caveats and appears to deal with Mac OS as an open source client as the installer is darwin rather than MacOS. Its just different and different can be dangerous so I’m a bit cautious.

Thanks again and I’ll get back to you.



The balena site has some great projects, but will require more time and experience that I can muster at this time. I’ll check back this summer to see if any updates have occurred. I would like to use the ‘AdBlocker’ project in my IoT class Fall 2019. I did get a response from Daniel Andrade regarding the GPIO project that was unsuccessful for me. I was able to get the ‘Getting Starting” project to work, so I know my setup is fundamentally sound, but getting the pieces together for the other projects is a problem and all projects working on Mac and PC (maybe Linux).

Etcher is a great product.

Thank you, again.

Richard Park

Professor - CIT

School of Engineering and Technology

Richland College



… to teach the love of learning


Hi Richard,

Thank you for the kind words. We are happy to have you as part of the community.

Please let us know if we could help out further with anything. If you struggle with the standalone installation that I linked, it’d be great to hear where you get stuck. So we could improve the docs, the setup process, or the installer itself.