- Notifications
You must be signed in to change notification settings - Fork2.6k
Heroku's classic buildpack for Node.js applications.
License
heroku/heroku-buildpack-nodejs
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This is the officialHeroku buildpack for Node.js apps.
For more information about using this Node.js buildpack on Heroku, see these Dev Center articles:
For more general information about buildpacks on Heroku:
It's suggested that you use the latest version of the release buildpack. You can set it using theheroku-cli.
heroku buildpacks:set heroku/nodejs
Your builds will always used the latest published release of the buildpack.
If you need to use the git url, you can use thelatest tag to make sure you always have the latest release.Themain branch will always have the latest buildpack updates, but it does not correspond with a numbered release.
heroku buildpacks:set https://github.com/heroku/heroku-buildpack-nodejs#latest -a my-app
Even though it's suggested to use the latest release, you may want to lock dependencies - including buildpacks - to a specific version.
First, find the version you want fromthe list of buildpack versions.Then, specify that version withbuildpacks:set:
heroku buildpacks:set https://github.com/heroku/heroku-buildpack-nodejs#v176 -a my-appThis buildpack automatically exports node, npm, and any node_modules binariesinto the$PATH for easy use in subsequent buildpacks.
Having trouble? Dig it? Feature request?
For local development, you may need the following tools:
To make changes to this buildpack, fork it on GitHub.Push up changes to your fork, then create a new Heroku app to test it,or configure an existing app to use your buildpack:
# Create a new Heroku app that uses your buildpackheroku create --buildpack <your-github-url># Configure an existing Heroku app to use your buildpackheroku buildpacks:set <your-github-url># You can also use a git branch!heroku buildpacks:set <your-github-url>#your-branchIn order to download the latest plugins that have been released, run the following:
plugin/download.sh v$VERSIONMake sure the version is in the formatv#, ie.v7.
The buildpack tests useDocker to simulateHeroku's stacks.
To run the test suite:
make testOr to just test a specific stack:
make heroku-22-buildmake heroku-24-buildThe tests are run via the vendoredshunit2test framework.
To display the logged build outputs to assist with debugging, use the "echo" and "cat" commands. For example:
test() {local log_file var var="testtest" log_file=$(mktemp)echo"this is the log file">"$log_file"echo"test log file">>"$log_file"# use `echo` and `cat` for printing variables and reading files respectivelyecho$var cat$log_file# some cases when debugging is necessary assertEquals"$var""testtest" assertFileContains"test log file""$log_file"}
Running the test above would produce:
testtestthis is the log filetest log fileThe test output writes to$STD_OUT, so you can usecat $STD_OUT to read output.
About
Heroku's classic buildpack for Node.js applications.
Topics
Resources
License
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.
