Overview
Installing
Method 1. Installation through npm
Prerequisites
Before installing through npm, you need to make sure that Node.js (above v10) and npm have been installed in your environment (for more information, please see Node.js Installation Guide) .
$ node -v
v12.18.0
$ npm -v
7.0.10
Note:
To ensure the installation speed and stability, we recommend you use cnpm for installation: download and install cnpm first, and then replace all the npm commands used below with cnpm commands.
Installation steps
Run the following command on the command line:
npm install -g serverless
Note:
If macOS prompts that you have no permission, you need to run sudo npm install -g serverless
for installation.
If you have already installed Serverless Framework, you can run the following command to upgrade it to the latest version:
After the installation is completed, run the serverless -v
command to view the version information of Serverless Framework:
Method 2. Binary installation
If Node.js is not installed in your local environment, you can install it directly in binary mode:
macOS/Linux
Open the command line and enter the following command:
curl -o- -L https://slss.io/install | bash
If you have already installed a binary version, you can run the following command to upgrade it:
Windows
Windows supports installation through Chocolatey. Open the command line and enter the following command: If you have already installed a binary version, you can run the following command to upgrade it:
After the installation is completed, run the serverless -v
command to view the version information of Serverless Framework:
Relevant Operations
Next step: getting started
Was this page helpful?