Friday, May 11, 2018

installing react native down the rabbit hole as usual

Assuming that you have Node installed, you can use npm to install the create-react-native-app command line utility:
npm install -g create-react-native-app



notadmin@programming:~$ npm install -g create-react-native-app
npm WARN checkPermissions Missing write access to /usr/lib/node_modules
npm ERR! path /usr/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/lib/node_modules'
npm ERR!  { Error: EACCES: permission denied, access '/usr/lib/node_modules'
npm ERR!   stack: 'Error: EACCES: permission denied, access \'/usr/lib/node_modules\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/lib/node_modules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/notadmin/.npm/_logs/2018-05-11T15_27_45_092Z-debug.log
notadmin@programming:~$ sudo npm install -g create-react-native-app
[sudo] password for notadmin:
notadmin is not in the sudoers file.  This incident will be reported.

FAIL


notadmin@programming:~$ su root
Password:
root@programming:/home/notadmin$ sudo npm install -g create-react-native-app
[sudo] password for root:
/usr/bin/create-react-native-app -> /usr/lib/node_modules/create-react-native-app/build/index.js
+ create-react-native-app@1.0.0
added 28 packages in 4.676s
root@programming:/home/notadmin$


https://facebook.github.io/react-native/docs/getting-started.html


npm i -g npm

─────────────────────────────────────────────────┐
│                   npm update check failed                    │
│             Try running with sudo or get access              │
│             to the local update config store via             │
│ sudo chown -R $USER:$(id -gn $USER) /home/admin/.config │


FAIL

only sudo npm i -g npm

works!


sudo npm i -g npm
npm WARN rm not removing /usr/bin/npx as it wasn't installed by /usr/lib/node_modules/npm
/usr/bin/npm -> /usr/lib/node_modules/npm/bin/npm-cli.js
/usr/bin/npx -> /usr/lib/node_modules/npm/bin/npx-cli.js
+ npm@6.0.1
added 246 packages, removed 40 packages and updated 125 packages in 10.898s


su notadmin
Password:
notadmin@programming:~$ yarn cache clean
yarn cache v1.6.0
success Cleared cache.
Done in 1.72s.
notadmin@programming:~$ create-react-native-app AwesomeProject
The directory `AwesomeProject` contains file(s) that could conflict. Aborting.
notadmin@programming:~$ 



npm start

> AwesomeProject@0.1.0 start /home/notadmin/AwesomeProject
> react-native-scripts start

21:19:54: Unable to start server
  See https://git.io/v5vcn for more information, either install watchman or run the following snippet:
    sudo sysctl -w fs.inotify.max_user_instances=1024
    sudo sysctl -w fs.inotify.max_user_watches=12288
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! AwesomeProject@0.1.0 start: `react-native-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the AwesomeProject@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/notadmin/.npm/_logs/2018-05-11T15_49_54_242Z-debug.log



https://github.com/react-community/create-react-native-app/issues/234
i dont know what they are going on that thread. but the issues was that the install got cut short due to a mistake i made in pressing the wrong key. this started all the problems 
1) The directory `AwesomeProject` contains file(s) that could conflict. Aborting.
2)   See https://git.io/v5vcn for more information, either install watchman or run the following snippet:




No comments:

Post a Comment