This topic describes how to install Node.js SDK and provides an operation example.


You can use npm to install Node.js SDK.

npm install aliyun-sdk


The following is an example of how to create a RAM user by using Node.js SDK:

ALY = require("aliyun-sdk")

// Construct an Alibaba Cloud client to initiate a request.
// Set the access key ID and access key secret.
// Alibaba Cloud Resource Access Management (RAM) is a global service. Its API endpoint is China (Hangzhou). Here, set "Region" to "cn-hangzhou".
var ram = new ALY.RAM({
        accessKeyId: "<access-key-id>",
        AccessKeysecret: "<access-key-secret>",
        endpoint: '',
        apiVersion: '2015-05-01'

// Construct the "CreateUser" request.
        Action: 'CreateUser',
        UserName: "alice"
}, function (err, res) {
        console.log(err, res);