Skip to content

Instantly share code, notes, and snippets.

@ericallam
Created January 12, 2012 15:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericallam/1601064 to your computer and use it in GitHub Desktop.
Save ericallam/1601064 to your computer and use it in GitHub Desktop.
Use versioned github tarballs to update dependencies on heroku cedar stack

Heroku cedar stack lets you deploy node.js apps and uses the npm package manager to install dependencies When pushing to heroku, it will install dependencies using npm install, and heroku helpfully caches your dependencies between deploys. This can be a problem when you update a dependency that uses a github tarball, like this:

// package.json
{
  "name": "node app name",
  "description": "",
  "version": "0.0.1",
  "dependencies": {
    "sandbox": "https://github.com/caike/sandbox/tarball/master",
  }
}

If you update sandbox on github, when pushing to heroku npm will not update the install because it already exists. Instead of just using master, tag your dependency with the version number and put that in the package.json:

// package.json
{
  "name": "node app name",
  "description": "",
  "version": "0.0.1",
  "dependencies": {
    "sandbox": "https://github.com/caike/sandbox/tarball/v0.8.0",
  }
}
@timruffles
Copy link

Thanks! Just to say to anyone who does this, I needed to increment the version inside the module referred to as well (obvious I know, erk :) )

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