Build & Deploy
Node.js

Node.js

Detection

Node.js applications are detected when the application contains a package.json file in the root of your project directory.

Runtime

The currently supported versions of Node.js are 16.x, 18.x, 19.x, and 20.x.

To specify the Node.js version to use, add or set the engines section in your package.json file:

package.json
{
  ...
   "engines": {
    "node": "18.x"
  }
  ...
}

If no version is specified in your package.json file, Node.js version 20.x will be used.

⚠️

Important: If you set the NODE_ENV environment variable to production, modules listed in devDependencies of your package.json will be removed once the build step has completed successfully.

To keep all modules listed in both dependencies and devDependencies at runtime when setting NODE_ENV to production, add the following environment variables in your Service configuration:

  • NPM_CONFIG_PRODUCTION=false if you use npm
  • YARN_PRODUCTION=false if you use yarn

Dependencies

Your project's dependencies are processed based on the package manager artifacts present in your repository.

By default, npm is used to manage dependencies. No specific files are required beyond your normal package.json file.