4

I wanted to download and run someone else's project in order to consider its functions. I ran into a number of problems ... that it does not deign to start, and I just don’t know what to do, help, please

https://github.com/sunlight3d/react_native_v0.49/tree/master/61-Realm%20React%20Native%235.Filter%20data%20and%20working%20with%20To-Many%20Relationships/code/tutorialProject

1) copied to the working folder tutorial project

2) opened VS code

3) went into the working folder and clicked open in cmd folder tutorial project

4) then I enter react-native run-android and get fiasco

d:\JS\tutorialProject>react-native init tutorialProject
 internal/modules/cjs/loader.js:657 throw err; ^

 Error: Cannot find module 'graceful-fs' at
 Function.Module._resolveFilename
 (internal/modules/cjs/loader.js:655:15) at Function.Module._load
 (internal/modules/cjs/loader.js:580:25) at Module.require
 (internal/modules/cjs/loader.js:711:19) at require
 (internal/modules/cjs/helpers.js:14:16) at Object.<anonymous>
 (d:\JS\tutorialProject\node_modules\react-native\local-cli\cli.js:12:1)
 at Module._compile (internal/modules/cjs/loader.js:805:30) at
 Object.Module._extensions..js (internal/modules/cjs/loader.js:816:10)
 at Module.load (internal/modules/cjs/loader.js:672:32) at
 tryModuleLoad (internal/modules/cjs/loader.js:612:12) at
 Function.Module._load (internal/modules/cjs/loader.js:604:3)

I started googling and found something to do with some dependencies. Using react-native init MyProject

5) react-native init tutorialProject and getting the tighter right line

I try to start the server through npm and then it's funny ... 6) npm-intall

d:\JS\tutorialProject>npm install npm WARN deprecated core-js@1.2.7:
 core-js@<2.6.5 is no longer maintained. Please, upgrade to core-js@3
 or at least to actual version of core-js@2. npm WARN deprecated
 connect@2.30.2: connect 2.x series is deprecated npm ERR! path
 d:\JS\tutorialProject\node_modules\.bin\react-native npm ERR! code
 EEXIST npm ERR! Refusing to delete
 d:\JS\tutorialProject\node_modules\.bin\react-native: is outside
 d:\JS\tutorialProject\node_modules\react-native and not a link npm
 ERR! File exists: d:\JS\tutorialProject\node_modules\.bin\react-native
 npm ERR! Move it away, and try again.

 npm ERR! A complete log of this run can be found in: npm ERR!
 C:\Users\Nick\AppData\Roaming\npm-cache\_logs\2019-04-16T18_15_13_614Z-debug.log

and here I am absolutely don't know. How to run someone else's project?

GianhTran
  • 3,443
  • 2
  • 22
  • 42
  • I don't think so is meant for questions like this. You may also get better answer using [repository's issue page](https://github.com/sunlight3d/react_native_v0.49/issues) – Anthony Apr 16 '19 at 20:22

8 Answers8

11

When you download after you need to install all package in package.json

npm install --save

then you need to start another terminal

npm start -- --reset-cache / npm start / react-native start 

It's for starting your bundler

finally you can run your project

react-native run-android 
errorau
  • 2,121
  • 1
  • 14
  • 38
0

From a computer with node install, you navigate a command line to the root of the project folder.

Then you install dependencies:

npm i

This installs all the libraries the project needs to build

Then you run the projects build script. This is defined in the projects package.json file. In that projects case, the script is called start. So:

npm run start

SpeedOfRound
  • 1,210
  • 11
  • 26
0

all dependencies and plugins have configured in package.json file. so you need to install:

npm install

then, you can start

react-native run-android

or

npm run start
Narasimhan R
  • 51
  • 1
  • 2
  • 15
  • when i write npm install i have a error ___ path d:\JS\tutorialProject\node_modules.bin\react-native npm ERR! code EEXIST npm ERR! Refusing to delete d:\JS\tutorialProject\node_modules.bin\react-native: is outside d:\JS\tutorialProject\node_modules\react-native and not a link npm ERR! File exists: d:\JS\tutorialProject\node_modules.bin\react-native npm ERR! Move it away, and try again. – Михаил Чаушевский Apr 17 '19 at 05:33
  • delete `node_modules` folder and tryagain it will work.... cuz those file already exist there so error.. – Narasimhan R Apr 17 '19 at 11:27
  • use commend react-native/run-android – Narasimhan R Nov 16 '21 at 13:18
0

if you already have a bundle app (android or ios ...)

react-native run-android / react-native run-ios 

else you should run

react-native start

and then run :

react-native run-android (or ios)
Alwani Anis
  • 260
  • 3
  • 11
0

This is the answer when you compile on windows and android studio

1.Open cmd(as an admin) 2. Npm install 3. Wait for build gradle in Android studio done compiling 4. Run on cmd react-native android-run

Sometimes you may get this error (refer image below)

This is a failure to build because of gradle error. To solve this, you may try to delete the files/folder in the error message and run again react-native android-run.

enter image description here

  • Hello and welcome to SO! Please read the [tour](https://stackoverflow.com/tour), and [How do I write a good answer?](https://stackoverflow.com/help/how-to-answer) [Please do not upload images of code/errors when asking a question.](//meta.stackoverflow.com/q/285551) – Tomer Shetah Jan 19 '21 at 08:15
  • Thanks for the notice. Actually this is the answer rather than questions. – Asyraf Roszaki Jan 20 '21 at 09:14
0

Just run

  1. npm cache clean --force
  2. npm i or npm install
Lavande
  • 744
  • 8
  • 20
Kevin R
  • 1
  • 2
0

All these answers say to use npm but you might run into issues with global dependencies if you have multiple projects or versions.

It's better if you use npx to have the dependency packages contained in the project folder.

This worked for me but I had to control-c it a few times:

npx react-native start --reset-cache && npx react-native run-android

or just:

npx react-native run-android

-1

Install Chocolatey Chocolatey is a popular package manager for Windows. So at first, we need to install it on our system.

To install Chocolaty, Open Command Prompt with administrator privileges and run the command below.

@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

choco install -y nodejs.install python2 jdk8.

npm install –g react-native-cli

More Detail Follow this

enter image description here

Path in user variable upper section enter image description here

enter image description here

enter image description here

Sourabh Gera
  • 862
  • 7
  • 7