1

So I'm opening my the existing React Native project. This is the procedure on how I opened my existing React Native project. 1st step, type the location of my project which is in the "D:\rnprojects\firstproject\". 2nd step, "react-native-start". 3rd step, I opened another cmd then locate it again into my project directory then typed "npm start".

Why when I created this project I didn't get this error just when runnning/opening my existing project.

This the error that I got: (with versions) enter image description here

4 Answers 4

1

There is only simple steps can solve your particular scenario issue quickly.

1) Install the React native cli in your project or globally.

npm install -g react-native-cli 

OR

npm install react-native --save

then start your project by using this command

npm start 

If any dependencies issue please follow the second solution

2) Please make sure you're installed all dependence

 yarn install 

OR

 npm install 

under your project directory

I'm pretty sure your issue will fix by using 1st solution Thanks.

Sign up to request clarification or add additional context in comments.

2 Comments

in "npm install react-native --save" should i install it globally or just in the project directory?
Just under the project
0

it is simple: 1.npm install 2.react-native run-android

Comments

0

Here I guess you have the RN environment to run already on your side.

  1. cd path_to_project
  2. install packages(there are two following ways to install packages).
    2.1 yarn install
    2.2 npm install
    react-native link(optional - you need to run this command if existing project use RN packages which need to link such as react-native-vector-icons)

  3. optional(if project use pods) cd ios pod install

  4. react-native run-ios or react-native run-android according to the platform which you want to run on.

I don't think above is perfect instruction give you how to run the existing react-native project, But I am pleasure if give me some hints or help to you.

You can find official guide here

Comments

0

Sometimes npm's cache gets confused and need to reset it by using below command:

npm cache clean --force

Also try below command:

npm install --save-dev react-native-cli

Hope it will help you.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.