Skip to content

Instantly share code, notes, and snippets.

@dannyvassallo
Last active June 3, 2016 00:00
Show Gist options
  • Save dannyvassallo/89a89670693557974bf02b209507077f to your computer and use it in GitHub Desktop.
Save dannyvassallo/89a89670693557974bf02b209507077f to your computer and use it in GitHub Desktop.
Because I keep reiterating this and it may help some students.

#Don't Add Your node_modules to git / github. ####Follow the instructions to not do this.

First and foremost you should be initializing NPM with npm init when you start a new node project. If you aren't doing this now, you need to start immediately.

Secondly, you should be installing your node packages for your project using npm install <package name> --save If you aren't doing this now, you need to start immediately.

Now -- Follow these steps to make git ignore your node_modules folder.

  1. Create a .gitignore file in the root of your repo.

  2. Open that file and place the following line in it:

node_modules
  1. Save that file.

  2. Add, commit, and push the branch.

  3. $$$$$$$$$$$$$$$$$$

If you look in your repo and see a node_modules folder after following these steps and setup, you've done something wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment