One of the trickiest things has been trying to get Windows environments correctly configured, as the tools are npm based and want to be compiled natively and assumes it is on a Linux machine. Here is the simplest install script I have found
Step 0. Pre-step:
- Install Chocolatey via https://chocolatey.org/
Step 1. Install windows tools with chocolatey:
Open a PowerShell prompt as Administrator
- choco install nodejs.install –y
- choco install git –y
- (optional) choco install VisualStudioCode -y
Read more about configuring Visual Studio code for Blockchain development in my other post.
Step 2. Install the tools via npm:
Open a NEW PowerShell prompt as Administrator (to ensure that it reloads )
- npm install -g npm
- npm install -g –production windows-build-tools
- npm install -g ethereumjs-testrpc
- npm install -g truffle
You may see some error messages during npm installs. Many of these are just informational / optional components failing. You can test that it is all working by trying to run the commands truffle and testrpc.
Bonus Step: combining with Visual Studio Code
This is how I use Truffle & Visual Studio code together. Make sure you install and configure Visual Studio Code with the Solidity extensions.
If you navigate into the folder where your files are, typing “code .” will open Visual Studio Code in the current folder. Running the command after a truffle init gets you up and running quickly