Setup NodeJS

Truffle command requires Node.js in your WSL environment to work

Update your system packages:

sudo apt update
sudo apt upgrade

Install NVM

curl -o- | bash

Load NVM

source ~/.bashrc

Install Node.js and npm: For Ubuntu or Debian-based WSL instances, you can use the following command:

sudo apt-get install nodejs
nvm install 19

You can also follow the official instructions for installing Node.js and npm for other distributions:

Verify the installation: Run the following commands to check if Node.js and npm are installed correctly:

node -v
npm -v