NPM cannot install “truffle” on Windows

0 votes

I am trying to install "truffle" with npm, but I am not familiar with NodeJS and cant figure out why npm wont install it. I try npm install -g truffle in Powershell with Admin rights and after a few lines of output I get this block of error messages:

 gyp ERR! build error
 gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
 gyp ERR! stack     at ChildProcess.onExit (F:\nodeJS\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
 gyp ERR! stack     at emitTwo (events.js:87:13)
 gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
 gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
 gyp ERR! System Windows_NT 10.0.14393
 gyp ERR! command "F:\\nodeJS\\node.exe" "F:\\nodeJS\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
 gyp ERR! cwd C:\Users\Max\AppData\Roaming\npm\node_modules\truffle\node_modules\ether-pudding\node_modules\ethereumjs-testrpc\node_modules\ethereumjs-wallet\node_modules\scrypt.js\node_modules\scrypt
 gyp ERR! node -v v4.5.0
 gyp ERR! node-gyp -v v3.4.0
 gyp ERR! not ok\

And then after many many yellow lines I finally get this:

 npm ERR! Windows_NT 10.0.14393
 npm ERR! argv "F:\\nodeJS\\node.exe" "F:\\nodeJS\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "truffle"
 npm ERR! node v4.5.0
 npm ERR! npm  v2.15.9
 npm ERR! code ELIFECYCLE

 npm ERR! scrypt@6.0.3 install: `node-gyp rebuild`
 npm ERR! Exit status 1
 npm ERR!
 npm ERR! Failed at the scrypt@6.0.3 install script 'node-gyp rebuild'.
 npm ERR! This is most likely a problem with the scrypt package,
 npm ERR! not with npm itself.
 npm ERR! Tell the author that this fails on your system:
 npm ERR!     node-gyp rebuild
 npm ERR! You can get information on how to open an issue for this project with:
 npm ERR!     npm bugs scrypt
 npm ERR! Or if that isn't available, you can get their info via:
 npm ERR!
 npm ERR!     npm owner ls scrypt
 npm ERR! There is likely additional logging output above.

 npm ERR! Please include the following file with any support request:
 npm ERR!     F:\eth_truffle\npm-debug.log
Sep 27, 2018 in Blockchain by digger
• 26,550 points
555 views

1 answer to this question.

0 votes

Your install is failing at node-gyp rebuild. Solutions to this problem are listed on the node-gyp repo. The quickest is:

"Option 1: Install all the required tools and configurations using Microsoft's windows-build-tools using npm install --global --production windows-build-tools from an elevated PowerShell or CMD.exe (run as Administrator)." This will install Python and Visual Studio correctly.

Also, you are using Node 4.5. The recommended version is 5+, according to the Truffle Docs

answered Sep 27, 2018 by slayer
• 29,050 points

Related Questions In Blockchain

+1 vote
5 answers

How to install Ganache.appx on Windows 7

Go to https://github.com/trufflesuite/ganache/releases there are a set of ...READ MORE

answered Aug 17, 2018 in Blockchain by Omkar
• 67,520 points
1,092 views
0 votes
1 answer

Not able to install truffle using npm install -g truffle

You need root access to install truffle, ...READ MORE

answered Nov 29, 2018 in Blockchain by Omkar
• 67,520 points
507 views
0 votes
1 answer

How to install truffle on Linux?

You can install Truffle using npm(node package manager). ...READ MORE

answered Feb 28 in Blockchain by Rishab
312 views
0 votes
1 answer

How to install Ethereum on Windows?

Download geth installer from https://geth.ethereum.org/downloads/ After download, run ...READ MORE

answered Feb 28 in Blockchain by Raj
169 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
141 views
0 votes
1 answer
0 votes
1 answer

Solidity geth: Error encountered during contract execution [Bad instruction]

recipes is a dynamic storage array. You need ...READ MORE

answered Oct 15, 2018 in Blockchain by Omkar
• 67,520 points
77 views
0 votes
1 answer
0 votes
1 answer