Backstory: I've been given a lender computer from the school I'm attending and I was attempting to
npm install global packages for my react-native project. I was able to install the packages, but my programs didn't appear to know how to actually access those globally installed packages. That's my theory at least. So I started going down the google rabbit hole ...
The first error I was getting was:
expo command not found (expo being Expo CLI, the react-native related package I had install globally numerous times by now), so I went to the provided site and entered the suggested command:
echo $PATH in terminal.
Echo $Path the above author said:
check if `/users/me/.npm-global/bin` is in your path.
The response from my machine was:
The author than proceeded to say:
If it isn’t there, you will need to add it to the path. Open up ~/.bash_profile then add the following line to the bottom:
Well, it appeared that I didn't have a
~/.bash_profile, I assume it said
no such directory found or something to akin to that. I can't simulate this error anymore because well ... my terminal at this time immediately crashes on startup.
So, I visited this stackExchange question which asked "How to create ~/.bash_profile and ~/.profile". I followed the steps from the top solution which by all accounts, seemed to successfully create the file.
With the file now seemingly made, I returned back to the original linked site and entered
~/.bash_profile which opened the file and "add[ed] the following line to the bottom:"
# NPM global installs export PATH=$PATH:~/.npm-global/bin
Follow that I returned to the shell and entered:
I don't have access (currently) to the error I was getting when I entered that command in the shell, but I believe the error was something related to the directory wasnt found.
Anyway, I changed something ... I think(?) I added the line
source ~/.bash_profile to the nano terminal window where I earlier entered the above command ... but at this point I can even get back there to confirm that was the case.
So that's where I am now, I still can't access the globally installed files or at this point even open my terminal without it instantly closing.
On last thing, i entered
usr/bin:/bin:/usr/sbin:/sbin in the
iterm2 > preferences > profiles > general > command destination. That's exactly where I am now and why my iterm broken pipe error says what it says.