Installing Serverless Framework

Last updated: 2020-09-14 15:17:15

    This document describes how to quickly install Serverless Framework through binary installation or npm.

    Installing

    Method 1. Binary installation

    If Node.js is not installed in your local environment, you can install it directly in binary mode:

    Note:

    Starting from September 1, 2020, Node.js10.0 or earlier versions are no longer supported on Serverless. Upgrade it as needed.

    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:

    $ serverless upgrade

    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.

    Viewing Version Information

    After the installation is completed, run the serverless -v command to view the version information of Serverless Framework:

    $ serverless -v

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback
    Help