| title | 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.
npm install
npm run buildIf 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
{
"engines": {
"node": ">=0.10.3 <15"
}
}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.
BP_NODE_RUN_SCRIPTS = lint,build
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
web: npm start