You can quickly install Serverless Framework through npm or binary installation.
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.
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:
npm update -g serverless
After the installation is completed, run the serverless -v
command to view the version information of Serverless Framework:
serverless -v
If Node.js is not installed in your local environment, you can install it directly in binary mode:
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:
serverless upgrade
Windows supports installation through Chocolatey. Open the command line and enter the following command:
choco install serverless
If you have already installed a binary version, you can run the following command to upgrade it:
choco upgrade serverless
After the installation is completed, run the serverless -v
command to view the version information of Serverless Framework:
serverless -v
Next step: getting started
Was this page helpful?