To manage objects in Alibaba Cloud Object Storage Service (OSS) from a Node.js application, install the OSS SDK for Node.js.
Prerequisites
Environment requirements
The SDK requires Node.js 8.0 or a later version.
See Install Node.js to download and install the build and runtime environment.
Check your Node.js and npm versions
Run the following command to check your Node.js version:
node -vRun the following command to check your npm version:
npm -v
Install the SDK
Select an SDK version
If you use Node.js 8.0 or later, install the latest 6.x version of the SDK.
For Node.js versions earlier than 8.0, install a 4.x version of the SDK.
Run the appropriate command to install the SDK.
To install a 6.x version:
npm install ali-oss@^6.x --saveTo install a 4.x version:
npm install ali-oss@^4.x --save
Verify the installation
Run the following command to verify the ali-oss package installation and view its version.
npm list ali-ossA successful installation produces output similar to the following:
your-project-name@ /path/to/your/project
└── ali-oss@6.x.xNext steps
After installing the SDK, configure access credentials.