1

I'm trying to push a site to the gh-pages branch on Github... I need to include the node_modules/ folder but git is not even letting me add it to commit the changes... I understand this is the desired behavior, since you don't want to include the dependencies while developing. But I'm trying to deploy live here... so I need to include all the dependencies...

Any ideas?

Leo Javier
  • 1,383
  • 12
  • 19
  • 3
    You should be able to commit the changes if `node_modules/` is not in your `.gitignore` – myconode Dec 14 '15 at 19:10
  • is not in my `.gitignore` file... but still... is not adding the folder :/ – Leo Javier Dec 14 '15 at 19:11
  • Can you link to your project if its public? – myconode Dec 14 '15 at 19:12
  • sure! is here https://github.com/leojavier/argonite-site/tree/gh-pages – Leo Javier Dec 14 '15 at 19:13
  • 1
    Checked it out. After `npm install` I was able to commit the folder. However, Github pages only hosts static sites, so you do not need to check in `node_modules`. See this stackoverflow issue for more details: http://stackoverflow.com/a/15719098/3108699 – myconode Dec 14 '15 at 19:21

2 Answers2

0

There is probably a better way but I was able to get it to work by moving the node_modules folder to extra_modules and then updating my script references in index.html.

As long as the modules don't include any executable files, it should work fine.

user3467534
  • 231
  • 1
  • 5
0

Add !node_modules/ to your .gitignore file

Lukas Chen
  • 373
  • 7
  • 15