You can install Alibaba Cloud ROS CDK on Linux, Windows, and macOS.
Prerequisites
Node.js and TypeScript must meet the following version requirements:
-
Node.js: 14.17.0 or later.
-
TypeScript: 3.8 or later.
Install ROS CDK on a Linux platform
The following example uses a CentOS 8.2 64-bit system.
-
Run the following commands to install Node.js, npm, tsc, and lerna.
# Install the required packages because ROS CDK is developed using TypeScript. sudo yum install -y nodejs npm sudo npm install typescript -g sudo npm install lerna -gNoteIf the installed Node.js version does not meet the requirements, download and install a compatible version from the official Node.js website.
-
Run the following command to install the CLI.
sudo npm install @alicloud/ros-cdk-cli -g -
Run the following command to view the list of ROS CDK features.
sudo ros-cdkExpected output:
Usage: ros-cdk COMMAND Commands: ros-cdk init [TEMPLATE] Create a new, empty CDK project from a template. Invoked without TEMPLATE, the app template will be used. ros-cdk list [STACKS..] Lists all stacks in the app [aliases: ls] ros-cdk synthesize [STACKS..] Synthesizes and prints the ROS template for this stack [aliases: synth] ros-cdk deploy [STACKS..] Deploys the stack(s) named STACKS to ROS into your alicloud account ros-cdk diff [STACKS..] Compares the specified stack with the deployed stack or a local template file, and returns with status 1 if any difference is found ros-cdk destroy [STACKS..] Destroy the stack(s) named STACKS ros-cdk event [STACK..] Get resource events within the resource STACK ros-cdk resource [STACKS..] Get resources in the resource STACKS ros-cdk list-stacks [STACKS..] Get resources in the resource STACKS ros-cdk load-config Load Aliyun CLI config to CDK. ros-cdk config Set your alicloud account configuration. Options: --json, -j Use JSON output instead of YAML when templates are printed to STDOUT [boolean] [default: false] --ignore-errors Ignores synthesis errors, which will likely produce an invalid output [boolean] [default: false] --trace Print trace for stack warnings [boolean] --strict Do not construct stacks with warnings [boolean] --version Show version number [boolean] -h, --help Show help [boolean] If your app has a single stack, there is no need to specify the stack name If one of cdk.json or ~/.cdk.json exists, options specified there will be used as defaults. Settings in cdk.json take precedence.
Install ROS CDK on a Windows platform
The following example uses a Windows Server 2016 64-bit system.
-
Install Node.js.
-
Go to the official Node.js website to download the Node.js installation package.
-
Follow the on-screen instructions to install Node.js.
-
In a command prompt window, run the following command to check the Node.js version.
node --version v14.17.0
-
-
Run the following commands to install tsc and lerna.
# Install the required packages because ROS CDK is developed using TypeScript. npm install typescript -g npm install lerna -g -
Run the following command to install the CLI.
npm install @alicloud/ros-cdk-cli -g -
Run the following command to view the list of ROS CDK features.
ros-cdkExpected output:
Usage: ros-cdk COMMAND Commands: ros-cdk init [TEMPLATE] Create a new, empty CDK project from a template. Invoked without TEMPLATE, the app template will be used. ros-cdk list [STACKS..] Lists all stacks in the app [aliases: ls] ros-cdk synthesize [STACKS..] Synthesizes and prints the ROS template for this stack [aliases: synth] ros-cdk deploy [STACKS..] Deploys the stack(s) named STACKS to ROS into your alicloud account ros-cdk diff [STACKS..] Compares the specified stack with the deployed stack or a local template file, and returns with status 1 if any difference is found ros-cdk destroy [STACKS..] Destroy the stack(s) named STACKS ros-cdk event [STACK..] Get resource events within the resource STACK ros-cdk resource [STACKS..] Get resources in the resource STACKS ros-cdk list-stacks [STACKS..] Get resources in the resource STACKS ros-cdk load-config Load Aliyun CLI config to CDK. ros-cdk config Set your alicloud account configuration. Options: --json, -j Use JSON output instead of YAML when templates are printed to STDOUT [boolean] [default: false] --ignore-errors Ignores synthesis errors, which will likely produce an invalid output [boolean] [default: false] --trace Print trace for stack warnings [boolean] --strict Do not construct stacks with warnings [boolean] --version Show version number [boolean] -h, --help Show help [boolean] If your app has a single stack, there is no need to specify the stack name If one of cdk.json or ~/.cdk.json exists, options specified there will be used as defaults. Settings in cdk.json take precedence.
Install ROS CDK on a macOS platform
The following example uses a macOS 13.2.1 64-bit system.
-
Run the following commands to install Node.js, npm, tsc, and lerna.
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash nvm install 20 npm install -g typescript npm install -g lernaNoteAlternatively, you can download and install a compatible version from the official Node.js website.
-
Run the following command to install the CLI.
npm install @alicloud/ros-cdk-cli -g -
Run the following command to view the list of ROS CDK features.
ros-cdkExpected output:
Usage: ros-cdk COMMAND Commands: ros-cdk init [TEMPLATE] Create a new, empty CDK project from a template. Invoked without TEMPLATE, the app template will be used. ros-cdk list [STACKS..] Lists all stacks in the app [aliases: ls] ros-cdk synthesize [STACKS..] Synthesizes and prints the ROS template for this stack [aliases: synth] ros-cdk deploy [STACKS..] Deploys the stack(s) named STACKS to ROS into your alicloud account ros-cdk diff [STACKS..] Compares the specified stack with the deployed stack or a local template file, and returns with status 1 if any difference is found ros-cdk destroy [STACKS..] Destroy the stack(s) named STACKS ros-cdk event [STACK..] Get resource events within the resource STACK ros-cdk resource [STACKS..] Get resources in the resource STACKS ros-cdk list-stacks [STACKS..] Get resources in the resource STACKS ros-cdk load-config Load Aliyun CLI config to CDK. ros-cdk config Set your alicloud account configuration. Options: --json, -j Use JSON output instead of YAML when templates are printed to STDOUT [boolean] [default: false] --ignore-errors Ignores synthesis errors, which will likely produce an invalid output [boolean] [default: false] --trace Print trace for stack warnings [boolean] --strict Do not construct stacks with warnings [boolean] --version Show version number [boolean] -h, --help Show help [boolean] If your app has a single stack, there is no need to specify the stack name If one of cdk.json or ~/.cdk.json exists, options specified there will be used as defaults. Settings in cdk.json take precedence.