Installing
Method 1. Binary installation
If Node.js is not installed in your local environment, you can install it directly in binary mode:
Note:
You are recommended to use Node.js 10.0 or above; otherwise, Component v2 may report errors during deployment.
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: $ choco install serverless
If you have already installed a binary version, you can run the following command to upgrade it:
$ choco upgrade serverless
Method 2. Installation through npm
Note:
You are recommended to use Node.js 10.0 or above; otherwise, Component v2 may report errors during deployment.
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
If Node.js is not installed in your environment, you can install it as instructed in Node.js Installation Guide based on your system environment. After the installation is completed, run the serverless -v
command to view the version information of Serverless Framework:
Was this page helpful?