Installation

Install the required dependencies to start building DAIN services

Prerequisites

Before installing the DAIN CLI, you'll need Node.js version 20 or higher and npm (Node Package Manager) installed on your system.

Installing Node.js and npm

  1. Check if you have Node.js installed:

    node --version
    

    If the command returns a version number less than 20.0.0 or if you get a "command not found" error, you'll need to install or upgrade Node.js.

  2. Install Node.js:

    • Option 1: Direct Download
    • Option 2: Using Node Version Manager (nvm) - Recommended
      • For Unix-based systems (Linux, macOS):
        # Install nvm
        curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
        
        # Restart your terminal, then:
        nvm install 20
        nvm use 20
        
      • For Windows:
        • Use nvm-windows
        • Follow the installation instructions in their repository
  3. Verify npm installation:

    npm --version
    

    npm comes bundled with Node.js, so you should have it installed automatically.

Installing DAIN CLI

Once you have Node.js and npm set up, install the DAIN CLI globally using npm:

npm install -g @dainprotocol/cli