10 minutes
In this exercise we will learn to set up our local development environment and create a new node.js project. This will be our codebase to create the Space travel application.
- Setup npm registry
npm set @sap:registry=https://npm.sap.com
- Install cds command line tool.
npm i -g @sap/cds
Now, the following command should print the version information
cds --version
At the time of writing this exercise the newest version is 3.5.2
- With the
cds initcommand a new project is created. Here, let us usecloud-sample-spaceflight-nodeas the project name. In addition, the option--modules srv,dbstating that we want to have service and db modules.The options--mtaand--db-technology hanaare for the creation of a mta.yml file with description needed once we move to the WebIDE environment.
cds init cloud-sample-spaceflight-node --modules srv,db --mta --db-technology hana
After the successful execution of the command a new directory cloud-sample-spaceflight-node is created together with a project structure and content within.
- Goto SAP Development tools page and scroll down to the end to download the CDS extension as shown. Click on the .vsix file and the file download will begin. This may trigger the license agreement popup if you are accessing the page for the first time. Click the
I Have Read And Agreebutton and proceed. In case the downloaded file is a zip archive, extract it.
- Launch the Visual Studio Code (VS Code) editor from your system and click on the
Extensionstab (last tab that is highlighted in the screenshot) on the upper left corner. Click on the icon with 3 dots to install the CDS extension that we downloaded in the previous step.
Choose the file with an extension of .vsix that was downloaded in the previous step.
- Once the extension is installed, a reload will be prompted. Click on
Reload Nowas shown.
- Goto the
Explorertab (first tab that is highlighted in the screenshot) of VS Code editor. ChooseFilemenu and then click onOpen Folder. Navigate to your working directory where thecds initcommand was executed in step number 3 and select thecloud-sample-spaceflight-nodefolder. This will open the project in VS Code as shown.
The project contains db and srv folders which corresponds to the Database and Service modules.
Package.json file contains the list of dependencies of the project. The "node_modules" folder contains dowloaded packages of these dependencies in our local develoment environment.
Congratulations, you just set up your local development environment and completed Exercise 1.
Click here to continue with Exercise 2.




