Mireia
Mireia

Reputation: 333

about 'zsh react-native command not found' AFTER SETTING PATH

Some time ago, I had the command not found error when running expo, so I set path at ~/.bash_profile and so, after running source ~/.bash_profile, now I can call expo without problems.

Today, I tried running react-native link and the following error appeared: zsh: react-native command not found

What else could I be doing wrong?

Upvotes: 0

Views: 1007

Answers (1)

cltsang
cltsang

Reputation: 1829

Maybe you don't have react native cli installed globally, which is good as it's not needed.

Check in the project directory if react-native is installed so ./node_modules/react-native/ should exist and has something inside.

If so, you don't need to run react-native directly; try running through npx react-native or npm script.

If not, make sure you have react-native in package.json dependencies section, and run npm install to pull the react-native library folder.

Upvotes: 2

Related Questions