All Products
Search
Document Center

ApsaraMQ for RocketMQ:Set up the Node.js environment

Last Updated:Mar 11, 2026

Install SDK for Node.js to send and subscribe to messages through the HTTP protocol of ApsaraMQ for RocketMQ.

Prerequisites

Before you begin, make sure that you have:

Check the Node.js version

Run the following command to verify that Node.js is installed and meets the version requirement:

node -V

The output must display version 7.6.0 or later.

Install SDK for Node.js

Run the following command to install the @aliyunmq/mq-http-sdk package:

npm i @aliyunmq/mq-http-sdk

Verify the installation

Run the following command to confirm that the SDK is installed and importable:

node -e "require('@aliyunmq/mq-http-sdk'); console.log('SDK for Node.js is installed.')"

If the command prints SDK for Node.js is installed. without errors, the setup is complete.

What's next

After the environment is ready, use SDK for Node.js to send and subscribe to messages: