NodeJS Builds

The NodeJS buildpack detects if your build is Node by looking for a package.json file. If found, the build will execute the following NPM (or Yarn) commands.

If no Procfile is found, a web process will be started with npm start .

You can customize the node version using the engines field of your package.json. For example

Custom Build Command

At the moment, we only support custom build commands wtih the Paketo buildpacks. To specify a custom build script, you can use the BP_NODE_RUN_SCRIPTS environment variable.

The example below will run the lint script followed by the build script.

Sample Node Procfile

Railway uses Procfiles to determine the start command of your application. For NodeJS, it's usually best practice to serve a compiled version of your application and serve the distribution via a start command defined in your package.json


Edit this file on GitHub