0

I want to upload a react app in github. But, I dont want to HOST IT. I only want to keep the codes there. But while uploading, I had problem with uploading the node_modules folder. I searched other repo, and even there node_modules folder wasn't present. Still their code could be used by running a command called npm install or something similar to that.


What are the steps to upload My ReactJS Code without uploading the node_modules. But in such a way, by which anyone can install all the node modules by npm install or something similar to that?

1
  • Just .gitignore the node_modules/ directory, which e.g. Create React App does by default. Commented Jun 3, 2021 at 15:24

1 Answer 1

2

To tell git to exclude something in your project, you use a .gitignore file. In the .gitignore file, you can add patterns to files or folders and git will not track any of those files.

Here is a template for Node projects given by GitHub. It excludes the node_modules folder. Put it in your project root and remember to rename it to just .gitignore (note the period in front).

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

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.