Skip to content

Latest commit

 

History

History
229 lines (125 loc) · 9.31 KB

File metadata and controls

229 lines (125 loc) · 9.31 KB

Developing Node.js in the Cloud Foundry Environment

This section offers selected information for Node.js development on SAP BTP, Cloud Foundry and references to more detailed sources.

You'll get information about the buildpack supported by SAP, the Node.js packages, and how to consume them in your application.

There is also a tutorial with an introduction to securing your application, and some tips and tricks for developing and running Node.js applications on SAP BTP, Cloud Foundry.

SAP BTP uses the standard Node.js buildpack provided by the Cloud Foundry community to deploy Node.js applications.

To get familiar with the buildpack and how to deploy applications with it, take a look at the Cloud Foundry Node.js Buildpack documentation.

You can download and consume SAP-developed Node.js packages via the SAP NPM Registry. There is an overview of Node.js packages developed by SAP, what they are meant for, and where they are included in the SAP HANA Developer Guide for XS Advanced Model. See:

The SAP BTP, Cloud Foundry environment provides one recent version of nodejs_buildpack as part of its system buildpacks. To check this version, proceed as follows:

  1. Log in to a particular SAP BTP region and subaccount. For example, if your region is eu10, run:

    cf api https://api.cf.eu10.hana.ondemand.com
    
  2. Then run:

    cf buildpacks
    

To learn about changes in the Node.js buildpack's versions and features, regularly check the latest buildpack releases in the GitHub community page.

To use this buildpack, specify its name when deploying a Node.js application to the SAP BTP, Cloud Foundry environment. You can do it the following ways:

  • Specify it directly in the cf push command:

    cf push -f <PATH_TO_APP_MANIFEST> -b nodejs_buildpack
    
  • Specify it in the manifest.yml file of your application by using the buildpacks attribute:

    ---
    applications:
    - name: <APP_NAME>
      memory: 512M
      buildpacks:
      - nodejs_buildpack
      ...
    

    Then, you can deploy the application like this:

    cf push <app_name>
    
  • Specify it in the mtad.yaml deployment descriptor file (for multi-target applications) by using the buildpack attribute:

    ...
    modules:
      - name: <APP_NAME>
        type: nodejs
        path: <path_to_archive>
        properties:
          ...
        parameters:
          ...
          memory: 512M
          buildpack: nodejs_buildpack
    ...
    

    Then, you can deploy the application like this:

    cf push <app_name>
    

The nodejs_buildpack running on SAP BTP, Cloud Foundry environment supports the following versions:

  • Node.js 18 – this version reached end of life on April 30, 2025.
  • Node.js 20 - this version is reaching end of life on April 30, 2026.
  • Node.js 22
  • Node.js 24

Node.js 20

Node.js 20 is reaching end of life on April 30, 2026 according to the Node.js Roadmap. It will stay available for a few more months on SAP BTP, Cloud Foundry environment but then it will be removed from there as well. When this version disappears, deployment and redeployment of Cloud Foundry applications running on Node.js 20 will fail.

Action: We strongly recommend that you migrate your applications to Node.js 22 as soon as possible.

In exceptional cases (if you haven’t managed to switch to Node.js 22 in time), to avoid application failures during redeployment, you can pin the last buildpack version that contains Node.js 20, as provided by the nodejs-buildpack community. To learn how, see: Specify a buildpack version in manifest.yml

Node.js 18

Node.js 18 reached end of life on April 30, 2025 according to the Node.js Roadmap, and now is removed from the SAP BTP, Cloud Foundry environment as well. If you have not migrated to Node.js 20 or 22 yet, deployment and redeployment of Cloud Foundry applications running on Node.js 18 will fail.

Action: We strongly recommend that you migrate your applications to Node.js 22 as soon as possible (because Node.js 20 will also reach end of life in the next months).

In exceptional cases (if you haven’t managed to switch to Node.js 20 or 22 in time), to avoid application failures during redeployment, you can pin the last buildpack version that contains Node.js 18, as provided by the nodejs-buildpack community. To learn how, see: Specify a buildpack version in manifest.yml

If you are using MTA deployment descriptors, in your mtad.yaml file you need to define module type javascript.nodejs and set parameter buildpack to nodejs_buildpack. For example:


modules:
- name: myapp
  type: javascript.nodejs
  parameters:
    memory: 512M
    buildpack: nodejs_buildpack

If you want to pin a particular buildpack version (for example, 1.8.39), you can do it the following way:


modules:
- name: myapp
  type: javascript.nodejs
  parameters:
    memory: 512M
    buildpack: https://github.com/cloudfoundry/nodejs-buildpack.git#v1.8.39

To learn more, see MTA Module Types.

Remember:

SAP does not recommend use of deprecated Node.js versions, as support and security fixes are no longer provided for them.

To check the latest news and updates about the Node.js buildpack, go to its release notes: What's New for Node.js Buildpack

Note:

In May 2023, SAP migrated the root file system used in the Cloud Foundry environment in SAP BTP from the deprecated cflinuxfs3 stack to cflinuxfs4. If you are running Node.js applications on SAP BTP, Cloud Foundry using the Node.js buildpack, we recommend that you update and migrate your applications, as well as the Node.js buildpack. For more information about migration timelines, risks, and consequences, see:

If you encounter an issue while using the Node.js buildpack, you can:

  • Search for your problem in our Troubleshooting section.

  • Create an incident for your specific problem, using support component BC-CP-CF-BLDP. To provide the necessary details, use the following template: Initial Problem-Related Data

The following tutorial will guide you through creating a Node.js application in Cloud Foundry Command Line Interface (cf CLI), consuming a Cloud Foundry service, and setting up authentication and authorization checks. See: Create an Application with Cloud Foundry Node.js Buildpack

For selected tips and tricks for your Node.js development, see Tips and Tricks for Node.js Applications.