Before installation, it is assumed that node is available, which can be queried as shown here. If the node is not available, then the installation of node is required first in order to install truffle:
$ node -version v7.2.1
The installation of truffle is very simple and can be done using the following command via Node Package Manager (npm):
$ sudo npm install -g truffle
This will take a few minutes; once it is installed, the truffle command can be used to display help information and verify that it is installed correctly:
$ sudo npm install -g truffle Password: /us/local/bin/truffle -> /usr/local/lib/node_modules/truffle/build/cli.bundled.js /usr/local/lib
└── [email protected]
Type truffle at Terminal to display usage help:
$ truffle
This will display the following output:
Alternatively, the repository is available at https://github.com/ConsenSys/truffle, which can be cloned locally to install truffle. Git can be used to clone the repository using the following command:
$ git clone https://github.com/ConsenSys/truffle.git