Prepare the Local Development Environment
Install essential runtimes and tools for local development.
Overview
You will learn
- How to install Node.js and npm (Node Package Manager) as a runtime
- How to install essential tools like git and Cloud MTA Build Tool (
mbt)
Prerequisites
Steps
Node.js is a server-side runtime environment built on Chrome’s V8 JavaScript engine. It provides an event-driven, non-blocking (asynchronous) I/O and cross-platform runtime environment. It enables you to build scalable server-side applications using JavaScript and is open-source. ย Node.js can be used to build applications like command-line applications, web applications, REST API servers, and many else. It is mostly used to create network programs like web servers. For more information, visit the official site at https://nodejs.org.
Before you can start building your Node.js app, you need to install npm and Node.js. npm is included in the Node.js installation.
It is possible to download the libraries and organize the directories on your own and start that way. However, as your project (and list of dependencies) grows, this will quickly become messy. It also makes collaborating and sharing your code much more difficult.
We recommend using a package manager on your OS.
Install the Windows package manager Chocolatey.
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"Install Node.js
choco install nodejsInstall the Mac package manager Homebrew.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"Install Node.js
brew install nodejsInstall the Node.js from the official website.
To verify if the installation was successful, check the npm and node.js version. Open the command line and print for the installed version.
node -v
npm -vThis tool will create so-called .mtar archives, which are deployable packages that contain your entire project. The tool itself is an OS-dependent binary, but you can leverage npm to install the right version for your OS and append it to the Path variable. Run the following command to install this tool:
npm install -g mbtAnother tool that you will use often is git. It will allow you to copy (aka clone) existing code project from compatible pages such as https://github.com.
Use the package manager from step 1 to install this tool as well.
Resources
Discussion
Share feedback on this tutorial or join the conversation in SAP Community.