how to run an existing project of react native
Solution 1
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
Solution 2
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
Михаил Чаушевский
Updated on July 12, 2022Comments
-
Михаил Чаушевский almost 2 years
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
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 fiascod:\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 lineI try to start the server through
npm
and then it's funny ... 6)npm-intall
d:\JS\tutorialProject>npm install npm WARN deprecated [email protected]: 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 [email protected]: 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?
-
errorau about 5 yearscan you share u node version node -v and npm -v
-
Михаил Чаушевский about 5 yearsnpm 6.9.0 node 11.13.0
-
Михаил Чаушевский about 5 yearswhen 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.
-
Narasimhan R about 5 yearsdelete
node_modules
folder and tryagain it will work.... cuz those file already exist there so error.. -
Tomer Shetah over 3 yearsHello and welcome to SO! Please read the tour, and How do I write a good answer? Please do not upload images of code/errors when asking a question.
-
Asyraf Roszaki over 3 yearsThanks for the notice. Actually this is the answer rather than questions.
-
Narasimhan R over 2 yearsuse commend react-native/run-android