Overview

This topic provides a migration guide from the v2 Node.js Buildpack for Tanzu Application Service for VMs to the Tanzu Node.js Buildpack. By following this guide, you can migrate your existing Node.js applications running on Tanzu Application Service for VMs to Tanzu Application Service for Kubernetes or Tanzu Build Service.

Partner Integrations

The v2 Node.js Buildpack bundled a number of third-party integrations with partner utilities including Appdynamics, Contrast Security, Dynatrace, New Relic, Synopsys, and Snyk. The v3 Node.js Language Family Buildpack also includes a number of partner integrations. Each is implemented as an optional buildpack. See the Nodejs Release Notes for a list of included partner integration buildpacks.

Application Source Changes

Specifying a version of Node.js engine

Define a buildpack.yml file in your application's source code to specify a version of the Node.js engine as follows:

nodejs:
  # Use the version field to specify a version
  # for the Node.js dependency. Any valid semver constraint
  # (e.g. 1.2.*) is acceptable.
  version: 14.*

Optimizing memory usage

Define a buildpack.yml file in your application's source code to optimize memory usage as follows:

nodejs:
  # Use the optimize-memory field to configure Node.js to
  # optimize memory usage based on your system constraints.
  # Only boolean values (true/false) are acceptable.
  optimize-memory: true

Breaking changes in the Tanzu Node.js Buildpack

  1. An application is considered an offline application only if it contains a node_modules or npm-cache directory. In that case, those directories will serve as vendored locations for dependencies and the installation process will look there to satisfy their requirements.
  2. If you are building an NPM-based application with vendored dependencies and your application is missing dependencies, the build will fail with an error message. The v2 Node.js Buildpack would not have failed the build, but printed a warning message indicating that unmet dependencies may cause runtime issues. To validate that all modules are vendored, run npm list before pushing your application.
  3. The installation commands run by NPM are chosen based on the criteria listed in NPM Installation Process.

Unsupported Workflows

The following workflows are not currently supported in the Tanzu Node.js Buildpack:

  1. Specifying the NPM version in the engines field of package.json is not currently supported. The buildpack will provide the version of NPM that comes with the specified version of the Node.js engine.
  2. Specifying the Yarn version in the engines field of package.json is not currently supported.

The following workflows existed in the v2 Node.js Buildpack and will not be supported in the Tanzu Node.js Buildpack:

  1. Heroku-specific build steps such as heroku-prebuild and heroku-postbuild in package.json are not supported in the Tanzu Node.js Buildpack. You should use the standard prestart and poststart hooks instead.
check-circle-line exclamation-circle-line close-line
Scroll to top icon