The method to solve issues on npm install web3 on Windows 10

in #web37 years ago (edited)

Hi everyone,

I've gone through a couple tough ways setting web3 up on my machine and run it. After digging through the internet, I found many people has this issues, but most of the solutions are not working for me.
After I tried on several different methods, I found this way works on my machine (Windows 10 Pro). Now, I'm able to install web3 with no issue. (Or other packages related to node-gyp issues, such as "truffle unbox react")

I thought it would be great if I can post it here and wish to help people save their time if they are trying to set up web3 like me :P

So, first the error I received is some processes from "node-gyp rebuild" error and "scrypt" related issues. If you received some errors other than this, then this method might not be helpful to you.

Steps I took to solve this issues:

  1. Install NodeJS, Git

  2. Download Windows Visual Studio 2015
    a. Open Visual Studio 2015 and create "new project..."
    b. Select "Create new C++ project"
    c. You should see a menu that VS requested to install "Common Tools for Visual C++ 2015" and "Windows 8.1 SDK and Universal CRT SDK" (some processes in scrypt required tools from this Windows 8.1 SDK files)
    d. Select both and install

  3. Install/link python through npm command
    npm --add-python-to-path="true" --debug install --global windows-build-tools

  4. Set msvs_version to 2015
    npm config set msvs_version 2015 --global

  5. Install web3
    npm install web3

For the reference:
My npm version : 5.6.0
My node version: 8.9.4

Hope this would help!

Sort:  

Congratulations @fattydolphin! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

You published your First Post
You got a First Vote

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

Upvote this notification to help all Steemit users. Learn why here!

Congratulations @fattydolphin! You received a personal award!

1 Year on Steemit

Click here to view your Board

Support SteemitBoard's project! Vote for its witness and get one more award!

Congratulations @fattydolphin! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!