node.js - -bash: react-native: command not found -
i have installed brew, node 4.0+, watchman , flow, , received following when npm install -g react-native-cli:
/users/home/.node/bin/react-native -> /users/home/.node/lib/node_modules/react-native-cli/index.js react-native-cli@0.1.5 /users/home/.node/lib/node_modules/react-native-cli └── prompt@0.2.14 (revalidator@0.1.8, pkginfo@0.3.1, read@1.0.7, winston@0.8.3, utile@0.2.1) so assume react-native-cli has been installed well. when run react-native, says
-bash: react-native: command not found my node version 4.2.1, watchman 3.9, brew 0.9.5 (git 7ed6) , npm 2.14.7
you have make sure /usr/local/share/npm/bin in path use binaries installed npm.
add following ~/.bashrc:
export path="/usr/local/share/npm/bin:$path" and reload shell session.
if find don’t have /usr/local/share/npm/bin directory, npm may install packages in location. in case have use right path in line above.
one solution find path run:
npm list -g | head -n 1 this gives path npm install packages. not path want it’s close. example on linux gives /home/baptiste/.linuxbrew/lib; suffices replace lib bin correct path:
export path="/home/baptiste/.linuxbrew/bin:$path"
Comments
Post a Comment