- Node.js v14 - v18
- Windows, Linux, or macOS
Note: to install the latest version of
npm i -g npm
Node Package Manager (NPM) recommends installing
npm with a Node version manager to avoid permission errors when installing globally. To do so, follow the instructions for your operating system here.
node-gypfor compiling native add-on modules for Node.js. Truffle recommends installing the following
node-gypto avoid errors when installing Truffle. Follow the installation instructions here.
nvmto install a compatible version of Node.js. For example, to install Node.js v18 on OSX or Linux, run:
nvm install 18
Confirm that Node.js has been installed correctly by running
Warning: Avoid using the
sudo command when installing Truffle, this can cause permission errors.
In a terminal, use NPM to install Truffle:
npm install -g truffle
You may receive a list of warnings during installation. To confirm that Truffle was installed correctly, run:
Truffle requires a running Ethereum client which supports the standard JSON-RPC API. There are many to choose from, and some better than others for development. Refer to the Ethereum client section for more information.