macOS
Installation on macOS (bash/zsh)
1. Prerequisites
macOS 12 or later
Homebrew (optional but recommended)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Terminal: Built-in Terminal or iTerm2
2. Install Node.js (v22+) & npm
You can either use Homebrew or nvm for installing/managing Node versions:
Homebrew
To install using homebrew, run the following command in your preferred terminal:
brew update
brew install node@22
# Ensure in your PATH:
echo 'export PATH="/opt/homebrew/opt/node@22/bin:$PATH"' >> ~/.zshrc
source ~/.zshrcnvm (Node Version Manager)
To install using nvm, first install nvm and load it in your environment.
To install
nvmrun the following command:To load
nvm, add it to~/.zshrcor~/.bash_profile:Finally, install Node 22 by running the following command:
To verify the installation, you can check by running the following command:
Handling Gatekeeper & Remote-Signed Files Issues
Issue: Cannot open ‘xyz’ because Apple cannot check it for malicious software.
Unblock downloaded files and allow apps from anywhere (requires sudo for allowing apps):
⚠️ Use sparingly; re-enable with sudo spctl --master-enable
4. Install the P0 CLI
Issue: EACCES or permissions errors
Fix permissions and install PO CLI:
To verify the installation, you can run the following commands:
5. macOS Shell Setup
For Shell setup, ensure /usr/local/bin (or /opt/homebrew/bin) is in your PATH:
You can enable command-completion by running the following commands:
8. Proxy & Corporate Networks
Issue:
npm installstalling orp0 loginfailing behind proxy
Configure npm and Shell Proxy Settings:
Add these to ~/.zshrc so they persist.
9. Common Troubleshooting
zsh: command not found: p0
– Restart your terminal to reload PATH.– Check npm root -g and ensure p0 is there.
EACCES “permission denied”
– Fix ownership: sudo chown -R $(whoami) $(npm config get prefix)/*
AWS CLI not found in scripts
– Ensure Homebrew’s bin (/usr/local/bin or /opt/homebrew/bin) is in your PATH.
CLI hangs on p0 login
– Check $BROWSER env var: export BROWSER=open– If using Safari, allow pop-ups.
Last updated