Install the Truffle for VSCode dependencies¶
This page provides instructions for installing the Truffle for VSCode dependencies on Windows, MacOS, and Ubuntu. Once the dependencies are installed, when you restart VSCode the requirements page no longer appears.
Windows¶
Install the following dependencies if you don't have them already.
Node.js¶
- Download the LTS version of Node.js.
-
Install the downloaded
.msi
file in yourDownloads
folder. Check the following box on the Tools for Native Modules screen of the installer:If you didn't check the box, follow these steps.
-
When asked if you want to install the tools at the end of the main installer screen, answer
yes
for all. You may have to approve a few elevated commands with the Windows security popups. - If the previous step fails:
- Install the Visual Studio build tools with this installer.
- Select the build tools option and download and install. This is at least 1 GB, so it can take 30-40 minutes.
In a command prompt, check if you installed Node.js successfully:
C:\Users\vitalik>node --version
v16.14.0
Also, check if NPM is installed:
C:\Users\vitalik>npm --version
8.3.1
Version numbers should be returned.
Git¶
- Download the Git binary for Windows.
- Select the installer in your
Downloads
folder. - You can select the default installation options, or change them to your needs.
In a new command prompt, check if you installed Git properly:
C:\Users\vitalik>git version
git version 2.35.1.windows.2
Truffle and Ganache¶
In VSCode, on the Truffle for VSCode requirements page, select Install Truffle Suite
and Install Ganache
.
Check if you installed Truffle and Ganache successfully using the output channel in VSCode:
You should see no error messages.
MacOS¶
Node.js¶
On MacOS, install Node.js reliably by using Node Version Manager (NVM).
Install NVM¶
Copy the NVM install script into the terminal:
> curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
Check if you installed NVM successfully:
❯ nvm --version
0.39.0
Install Node¶
Install the LTS version of Node.js in the same terminal window:
> nvm install --lts
<you will see some install info>
Installing latest LTS version.
Downloading and installing node v16.14.0...
Downloading https://nodejs.org/dist/v16.14.0/node-v16.14.0-darwin-x64.tar.xz...
################################################################################################################################### 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v16.14.0 (npm v8.3.1)
Installing default global packages from /usr/local/opt/nvm/default-packages...
npm install -g --quiet faker-cli typescript yarn
added 5 packages, and audited 6 packages in 5s
found 0 vulnerabilities
❯ nvm use --lts
Now using node v16.14.0 (npm v8.3.1)
Check if you installed Node.js and npm successfully:
❯ node --version
v16.14.0
❯ npm --version
8.3.1
Git¶
Git is usually already installed on MacOS. If you don't have Git installed, enter the following into the terminal:
> xcode-select --install
In a new terminal window, check if you installed Git successfully:
❯ git --version
git version 2.32.0 (Apple Git-132)
Truffle and Ganache¶
You can install Truffle and Ganache from the Truffle for VSCode requirements page as for Windows, or you can install them using the command line:
> npm i -g truffle
> npm i -g ganache
This installs the latest versions of both binaries.
Ubuntu¶
Installing Node.js, Truffle, and Ganache on Ubuntu is the same as for MacOS. You might need to install NVM using the second wget
install script.
Git¶
Enter the following into the terminal:
sudo apt install git
In a new terminal window, check if you installed Git successfully:
❯ git --version
git version 2.32.0 (Apple Git-132)