Search code examples
zshmacos-big-sur

zprofile missing in OS X Big Sur and "read only filesystem" rejects creation of zprofile


Experiencing this issue on a brand new M1 MacBook Air. Attempted to follow this guide to set up nvm and Node. It worked at first but on subsequent sessions I started to get

zsh: command not found: node

zsh: command not found: npm

Et cetera - I realized I am running zsh and for some reason, I do not have a .zprofile, only a .bash_profile. tail ~/.bash_profile looks like this:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion

I cannot create a .zprofile file because I get touch: /.zprofile: Read-only file system.

I could try and force it with sudo, but given that I've messed up the rudimentary setup of this system, I am not inclined to further foobar the setup without a little assistance.


Solution

  • Change

    touch /.zprofile
    

    To

    touch ~/.zprofile
    

    There is a huge difference!