3
votes

enter image description hereI used the command truffle unbox react to build a dapp. It is just the initial step of my dapp development. However, it sucks. It continually pops up

gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1

this error. I've already google this error. Therefore, I set my python default version at 2.7 and install visual studio 2015 and visual studio 2017. Also I've reinstall node-gyp and npm to make sure if it is the latest version. And also, npm install --global --production windows-build-tools I've tried whatever I can google. PLEASE HELP!

1
Oh, I encoutered this one when fiddling with web3, if the npm windows-build-tools failed, try to open your VS2017, create a c++ console app build it and run it. Then restart your terminal and reinstall. Also I set the npm config npm config set msvs_version 2017 --global - keysl
@keys! Thanks for replying me. I've tried your solution, however it still not working. Did I misunderstand something? Can npm config be command individually? - Jessie
I've command npm config set msvs_version 2017 --global, it ran smoothly. If I try npm config, it gives me this error npm ERR! Usage: - Jessie
your right you just need to run npm config set msvs_version 2017 --global - keysl
just to make sure? are you running the cmd as administrator? - keysl

1 Answers

2
votes

I also had this problem, And finally I didn't realize what was going on.

but

my problem was solved that way

I uninstall node 12.14.1 and install 10.18.1 It's working now.