How To Set Up Visual Studio Code For CAP Development
How To Set Up Visual Studio Code For CAP Development
8 20 6,216
We all SAP developers know that SAP Cloud Application Programming Model is rocking these days for developing
enterprise grade services and applications. In order to develop the CAPM application, we can choose either Node.js or Java
as a language of choice and SAP Business Application Studio (BAS), Visual Studio (VS) Code, or Eclipse as an IDE of
choice. SAP Business Application Studio is a Web-based IDE that is preconfigured and ready to start development with no
additional configuration tasks whereas VS Code and Eclipse require additional tools to be installed for CAPM Development.
In this blog, we will see how to set up VS Code for the SAP CAPM development on the Windows platform. The
requirement of tools for CAPM on other operating systems like Mac OS, Linux might be the same but the process of
installation of tools is different.
1. Install Node.js
Download the latest version of Node.js and follow the installer prompts to install it on your machine.
To verify the installation of Node.js, run command node -v in Command Prompt. It should print the Node.js version.
Also, run command npm -v to ensure npm (package manager) is up and running.
3. Install CF CLI (Command Line Interface) for Cloud Foundry operations such as app
deployment, service creation, etc.
https://blogs.sap.com/2020/10/05/how-to-set-up-visual-studio-code-for-cap-development/ 1/3
4/10/22, 1:18 PM How to Set Up Visual Studio Code for CAP Development | SAP Blogs
To verify installation, run command mbt -v and it should print out the version info.
MBT tool requires GNU Make during the build of an application. Ensure you have GNU Make installed on your
machine. (If you have Chocolatey installed on your machine, simply run choco install make to install GNU Make)
Open Windows PowerShell with the administrator rights and run command npm install –global –production windows-
build-tools
Python Extension Pack – Required when running the npm install command on the project modules.
CDS Language Support Plug-in – Required for CDS development e.g. syntax highlighting, code completion, etc.
XML Tools or any XML Editor extension to work with XML files.
Download and install Java JDK 8 or higher if you already haven’t got it installed on your machine.
3. Install Maven
Download the maven package from the maven website. Unzip the downloaded package using any archive extraction
tool like 7-Zip etc.
Now you can move the extracted folder to your desired location e.g. “C:\Program Files”
https://blogs.sap.com/2020/10/05/how-to-set-up-visual-studio-code-for-cap-development/ 2/3
4/10/22, 1:18 PM How to Set Up Visual Studio Code for CAP Development | SAP Blogs
Don’t forget to also install extensions mentioned in Step 5 of Node.js environment setup.
Lombok – Required for Java annotation support. It is a must-have extension if you are working with SAP Java Cloud
SDK Virtual Data Model (VDM).
Java Extension Pack – Required for Java Development. Language Support for Java extension is part of this pack and it
may not work with Java 8 as it requires Java 11 or higher. If you wish to use Java 8, you may need to downgrade the
version of Language Support for Java to 0.64.0.
Remote Development Extension Pack – Required for SSH/Remote Debugging.
Common Issues that you may encounter for the first time
The Python issue – If you face python error during npm install
Ensure you have installed Windows build tools. If not, run command npm install –global –production windows-
build-tools for installation in Windows PowerShell with administrator rights.
Install Python Extension Pack in VS Code
If still error persists, install openssl on your machine and repeat the above steps of this section.
First, ensure you are logged into Cloud Foundry. If not, log in to Cloud Foundry (cf login) and try again.
If the issue persists, check which version of CF CLI is installed on your machine. If you installed CF CLI version V7,
try uninstalling it and installing V6 instead. As part of my research, people reported issues for CF CLI version V7.
Those issues might have been resolved by the time you are reading this blog.
https://blogs.sap.com/2020/10/05/how-to-set-up-visual-studio-code-for-cap-development/ 3/3