1

I'm using the aws-sdk module, which has a .gitignore file that ignores its own node_modules directories, breaking my Heroku deployment.

Is there a proper way to deal with this sort of situation? When I heroku bash I see that the dependencies are missing from aws-sdk it has no node_modules directory.

3
  • Are you checking in node_modules as part of your git project? Commented May 26, 2014 at 6:52
  • @SomeKittensUx2666 always do. my temporary fix is to remove the .gitignore from aws-sdk module. Seems strange that such a popular module wouldn't work out of the box on Heroku though... Commented May 26, 2014 at 17:51
  • Generally speaking, us Nodeists on Heroku don't check in node_modules (npm shrinkwrap is just as good, and is much smaller). Commented May 26, 2014 at 17:53

2 Answers 2

1

Typically, Heroku will run npm install for you after each deploy, but only if the node_modules folder is not already present.

You have two major options:

  • Stop checking in node_modules and switch to npm shrinkwrap to keep exact versions
  • Remove .gitignore from aws-sdk (not recommended, as you're modifying packages)

I suggest the first, as it allows you to keep the functionality checking in node_modules gives you, without losing anything or modifying other's packages.

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

Comments

0

A simple npm install as a part of your deployment script should take care of it for you assuming that you are listing aws-sdk as a dependency in your package.json.

2 Comments

I'll try this next time I have access. I was under the impression that Heroku atuomatically npm-installs on every deploy?
Even if it does, it only does it at the root level

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.