Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing react-native using create-react-native-app gives error

I want to learn React-native and I am following the official docs. and I am using create-react-native-app for installation.

I am also working for a project in reactjs which is also installed using create-react-app. When I tried to install react-native using cmd:

npm install -g create-react-native-app

I see the following error

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!  { Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!   stack: 'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

My mac already has a node_modules which is created during Reactjs Installation.

And when I run npm install create-react-native-app the modules are installed but the cmd for creating react native app didn't get recognized.

$create-react-native-app hello

-bash: create-react-native-app: command not found

Is it possible to work both in react-native and reactjs?

like image 208
anonymous_siva Avatar asked Aug 05 '26 05:08

anonymous_siva


1 Answers

Anything with -g requires a global install and requires sudo access. Because this installs globally.

sudo npm install -g create-react-native-app
like image 91
Ravi Avatar answered Aug 06 '26 22:08

Ravi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!