I am trying to start react-native but I get the following error zsh: command not found: react-native when I write react-native init firstApp
.
I tried the following guide: react-native: command not found
But I have two main issue:
First
I do not understand which path to use/export
React-native has been installed here:
/Users/cisco/.npm-packages/bin/react-native -> /Users/cisco/.npm-packages/lib/node_modules/react-native/local-cli/wrong-react-native.js
Second
In the guide it is written to run:
export PATH="/usr/local/Cellar/node/6.1.0/libexec/npm/bin:$PATH"
react-native init appName
cd appName
react-native run-ios
I do not get how to:
1) What to write after export PATH=
2) Should I add my path somewhere? If yes, how can I do so?
I tried running touch ~/.bash_profile; open ~/.bash_profile to add my path.
Inside it I have:
# added by Anaconda3 5.3.1 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
\eval "$__conda_setup"
else
if [ -f "/anaconda3/etc/profile.d/conda.sh" ]; then
. "/anaconda3/etc/profile.d/conda.sh"
CONDA_CHANGEPS1=false conda activate base
else
\export PATH="/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda init <<<
# added by Anaconda3 2018.12 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/Users/cisco/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
\eval "$__conda_setup"
else
if [ -f "/Users/cisco/anaconda3/etc/profile.d/conda.sh" ]; then
. "/Users/cisco/anaconda3/etc/profile.d/conda.sh"
CONDA_CHANGEPS1=false conda activate base
else
\export PATH="/Users/cisco/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda init <<<
Once you help me in finidng out the right path do add, can I simply add it in the file below the line # <<< conda init <<<?
Solved it!
Steps:
Run npm list -g | head -n 1
It will give you a path like/similar to the following: /Users/{YOUR_USER_NAME}/.npm-packages/lib
Change that path by substituting /lib with /bin:$PATH so that you get: /Users/cisco/.npm-packages/bin:$PATH
Run export PATH="/Users/{YOUR_USER_NAME}/.npm-packages/bin:$PATH"
Since you are using zsh. You can add export PATH=/Users/cisco/.npm-packages/bin/react-native:$PATH in ~/.zshrc
This operation work for me very well. Just follow the instruction below.
The default interactive shell is now zsh.
To update your account to use zsh, please run
chsh -s /bin/zsh
Related
first post on so; let me know any advice on better asking
Anyways, my current bash profile is:
# added by Anaconda3 2019.10 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/opt/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
\eval "$__conda_setup"
else
if [ -f "/opt/anaconda3/etc/profile.d/conda.sh" ]; then
. "/opt/anaconda3/etc/profile.d/conda.sh"
CONDA_CHANGEPS1=false conda activate base
else
\export PATH="/opt/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda init <<<
‘export PATH=/usr/local/mysql/bin:$PATH'
I was getting this info from the tutorial, https://www.youtube.com/watch?v=HXV3zeQKqGY , ~1 hour 7 mins in.
I don't have a conda env activated right now. Anyone have an idea why when I type "mysql" into my bash terminal I am returned "command not found"?
There may be a problem with you $PATH.
Open .bash_profile. and then Place export PATH=${PATH}:/usr/local/mysql/bin in it.
I just installed Anaconda. When I try to run a command, lets say conda --version, I get the following error message:
zsh: command not found: conda
When I type in:
source ~/.bash_profile
Everything works:
conda --version
conda 4.8.0
But I have to type the command every time I start the terminal.
My .bash_profile looks like this:
# added by Anaconda3 2019.10 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/Users/myusername/opt/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
\eval "$__conda_setup"
else
if [ -f "/Users/myusername/opt/anaconda3/etc/profile.d/conda.sh" ]; then
. "/Users/myusername/opt/anaconda3/etc/profile.d/conda.sh"
CONDA_CHANGEPS1=false conda activate base
else
\export PATH="/Users/myusername/opt/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda init <<<
What can I do to fix this?
System: macOS
place source ~/.bash_profile into ~/.zsh
Bash loads .bash_profile during init, for zsh it’s .zsh
Default shell was changed from bash to zsh with macOS Catalina, so that’s why there is the problem.
be kind I am very new to coding. I have an unexpected end of file in by bash_profile and I can't debug it. Would someone with more experience mind taking a look and help me get to the bottom of it?
# pipx
export PATH="~/.local/bin:$PATH"
# pyenv
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi
# poetry
export PATH="$HOME/.poetry/bin:$PATH"
# pip should only run if there is a virtualenv currently activated
export PIP_REQUIRE_VIRTUALENV=true
# commands to override pip restriction above.
# use `gpip` or `gpip3` to force installation of
# a package in the global python environment
# Never do this! It is just an escape hatch.
gpip(){
PIP_REQUIRE_VIRTUALENV="" pip "$#"
}
gpip3(){
PIP_REQUIRE_VIRTUALENV="" pip3 "$#"
}# added by Anaconda3 2019.07 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
\eval "$__conda_setup"
else
if [ -f "/anaconda3/etc/profile.d/conda.sh" ]; then
. "/anaconda3/etc/profile.d/conda.sh"
CONDA_CHANGEPS1=false conda activate base
else
\export PATH="/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda init <<<
I suggest to replace }# with } # in line 24.
I installed Anaconda on MacOS. I tried to run the conda command in terminal, but I got the following error message:
****/Users/rodalbert/.anaconda/navigator/a.tool ; exit;
/Users/rodalbert/.bash_profile:export:3: not an identifier: 2018.12
➜ ~ /Users/rodalbert/.anaconda/navigator/a.tool ; exit;
/Users/rodalbert/.anaconda/navigator/a.tool: line 1: syntax error near unexpected token `('
/Users/rodalbert/.anaconda/navigator/a.tool: line 1: `bash --init-file <(echo "source activate /Users/rodalbert/anaconda3;")'
[Process completed]****
I can't find the problem. Does someone know what to do in this case?
Content of .bash_profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
export PATH=/Applications/Postgres.app/Contents/Versions/11/bin/psql:$PATH# added by Anaconda3 2018.12 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
\eval "$__conda_setup"
else
if [ -f "/anaconda3/etc/profile.d/conda.sh" ]; then
. "/anaconda3/etc/profile.d/conda.sh"
CONDA_CHANGEPS1=false conda activate base
else
\export PATH="/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda init <<<
# added by Anaconda3 2018.12 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/Users/rodalbert/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
\eval "$__conda_setup"
else
if [ -f "/Users/rodalbert/anaconda3/etc/profile.d/conda.sh" ]; then
. "/Users/rodalbert/anaconda3/etc/profile.d/conda.sh"
CONDA_CHANGEPS1=false conda activate base
else
\export PATH="/Users/rodalbert/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda init <<<
It seems like you're using Zsh.
Before executing any command from within Anaconda Navigator, try opening your Terminal app and switching shell to bash: chsh -s /bin/bash then restart terminal.
After you're done with Anaconda, switch back to Zsh: chsh -s /bin/zsh then restart terminal.
I used MohammadChavos's solution, then conda can run on the terminal.
cd /path/to/anaconda/bin
./conda init zsh
or:
zsh conda init zsh
My case: cd opt/anaconda3/bin, then run: ./conda init zsh
I'm learning Go and I have some problem.
I following
go install
But an error:
no install location for directory /Users/skan/documents/study/golang/src/section1 outside GOPATH
For more details see: ’go help gopath’
so I return to my .bash/profile
this is my .bash/profile
# added by Anaconda3 2018.12 installer
# >>> conda init >>>
# !! Contents within this block are managed by ’conda init’ !!
__conda_setup=”$(CONDA_REPORT_ERRORS=false ’/anaconda3/bin/conda’ shell.bash hook 2> /dev/null)”
if [ $? -eq 0 ]; then
\eval ”$__conda_setup”
else
if [ -f ”/anaconda3/etc/profile.d/conda.sh” ]; then
. ”/anaconda3/etc/profile.d/conda.sh”
CONDA_CHANGEPS1=false conda activate base
else
\export PATH=”/anaconda3/bin:$PATH:$GOPATH:$GOBIN”
fi
fi
unset __conda_setup
# <<< conda init <<<
export GOPATH="/Users/skan/Documetns/study/golang"
export GOBIN=$GOPATH/bin
Try:
mkdir -p $GOPATH/bin
The error you're seeing is the installation directory doesn't exist, so install can't do anything.
Also, there's a typo here:
export GOPATH="/Users/skan/Documetns/study/golang"
So, same reasoning, but, try Documents