0

I am a total beginner in React. I have forked an application on Github and am trying to run it on my local machine. However, as you can see, the folder structure does not have node modules. Does this mean I have to install create-react-app globally on my computer to actually run it locally?

I am getting errors saying "react-scripts is not found" and "typescript is not installed" when I run npm start.

enter image description here

Adarsh Kumar
  • 107
  • 1
  • 11

3 Answers3

4

You need to run npm install this will install necessary packages. This will look at the package.json file and install all the necessary modules.

For more information have a look at this.

Note: Make sure you have node installed in your system. To check if node is installed type node -v on your terminal.

Daryl Aranha
  • 106
  • 1
  • 8
2

Generally, while pushing our code to Git or any other version control, we avoid checking-in node modules with the code since it increases the size of the repository and are ideally not required. An interesting thread for you to explore - Should I check in node_modules to git when creating a node.js app on Heroku?

For your situation, you took the code from Git and are missing node modules. This is an ideal scenario and the solution is to install node modules by yourself over the system to run the code. To install the node modules, we have the command npm install. Run it and you'll be fine.

Sahil Sharma
  • 1,813
  • 1
  • 16
  • 37
  • Can you also tell me how to push this after I make a few edits, then create a Pull Request? If I push the app back to github, will I have to delete the node modules folder manually? – Adarsh Kumar Jul 18 '20 at 07:52
  • You can check this link for Git basics - https://git-scm.com/book/en/v2/Git-Basics-Getting-a-Git-Repository – Sahil Sharma Jul 18 '20 at 10:27
1

Hoping you have node installed,open command prompt and change the directory to your project location and run npm install

msapkal
  • 8,268
  • 2
  • 31
  • 48
  • Can you also tell me how to push this after I make a few edits, then create a Pull Request? If I push the app back to github, will I have to delete the node modules folder manually? – Adarsh Kumar Jul 18 '20 at 09:03