8

I have setup react-native in my system. I have mac OS X El Capitan.

After completing setup of react native, whenever i open my terminal and type command ls then, it shows "command not found".

export PATH="/usr/bin:/bin:/usr/sbin:/sbin"
export PATH="/usr/local/bin:/usr/local/sbin:$PATH"

After executing above two lines in my terminal, everything works fine. ls command is working after that. But once i close my terminal and again open it, ls command stops working and it shows "command not found".

I have also tried to add above two lines in .bash_profile file, but didn't get success. I don't know how to get rid of this issue.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Kirti Parghi
  • 1,142
  • 3
  • 14
  • 31
  • 1
    Put them in `.bashrc` file? – Jean-Baptiste Yunès Apr 26 '17 at 11:43
  • 1
    `PATH` should be properly set by default. One of your shell config files (probably `.bash_profile`, maybe `.profile`) is probably incorrectly trying to add paths to it. Before you execute the above two lines, what is the output of `echo "$PATH"`? – chepner Apr 26 '17 at 12:34

1 Answers1

20

Add following line to you .bash_profile

export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/b‌​in

Simply you can do it by following command

echo "export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/b‌​in" >> ~/.bash_profile

After that please restart your terminal

Ebin Joy
  • 2,690
  • 5
  • 26
  • 39