On macOS, if you encounter the "shell-init: error retrieving current directory: getcwd: cannot access parent directories: Operation not permitted" error, please grant file access permissions to the terminal. Go to System Preferences > Security & Privacy > Privacy > Full Disk Access and select Terminal.