1. Install Node.js via NVM (Node Version Mananger) :
Run the Command, wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
Note :
- To avoid permission errors when installing globally, Node.js (NPM) recommends installing Node.js with a Node version manager (NVM) on Mac and Linux Operating systems
- When the NVM script finishes downloading you will receive a completion message that will instruct you to close and reopen your terminal to begin using NVM
2. Verify NVM Installation : nvm
3. Install a Truffle compatible version of Node.js : nvm install 18
Note : Verify that NPM is installed : npm
Note :
- It is good practice to run the npm doctor command after setting up the Node.js environment on the computer.
- Npm doctor checks whether the Npm installation packages are configured and installed correctly.
- Npm doctor always looks at the latest version of Npm version available.
- Ignore the warnings and continue onto installing Truffle in the next step.
Run the command, npm doctor
As per the comments, run the command : npm install -g [email protected]
4. Install Truffle : npm install -g truffle
Note : Some warnings or conflicts, may be listed this is typical and should work normally as long as there are no errors.
5. Verify that Truffle is installed : truffle version
- Truffle Suite Installation on Ubuntu 22.04 helped me to fix the errors in installing Truffle in Ubuntu
- Basic Writing & Formatting Syntax