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
-
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.
-
Install Node.js:
- Option 1: Direct Download
- Visit the Node.js official website
- Download and install the LTS version (20.x or higher)
- 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
- For Unix-based systems (Linux, macOS):
- Option 1: Direct Download
-
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