Skip to content

Commit

Permalink
Update on Gatsby Windows instructions (#1216)
Browse files Browse the repository at this point in the history
After solving this myself
  • Loading branch information
sebastienfi authored and KyleAMathews committed Jun 20, 2017
1 parent a0513a1 commit 44901ad
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions docs/docs/gatsby-on-windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,27 @@ powershell console. On installing this package, it downloads and installs the
Visual C++ Build Tools 2015, provided free of charge by Microsoft. These tools
are required to compile popular native modules. It will also install Python
2.7, configuring your machine and npm appropriately.

### If build or `npm i` fails you might want to try this

Sometimes the `windows-build-tools` won't properly install required librairies. This is true if you already have a regular .Net dev environment setup. This has been reported on Windows 10 x64 (and possibliy other arch or Windows versions).

You can identify the problem after running `npm i` on Gatsby, showing compilation errors with `node-gyp` or `sharp` or `binding.gyp not found`.

In that case, download the [Visual Studio Express 2015 Package](https://www.visualstudio.com/products/visual-studio-community-vs) and install the package `Programming languages > Visual C++ > Common tools for Visual Studio 2015`. You can uncheck everything else. You don't need to install the full VS2015 Express on your system and this won't mess up your existing VS201x installs.

Then run the commands on Gatsby:

`npm uninstall node-gyp -g`

`npm config set python python2.7`

`npm config set msvs_version 2015`

`npm cache clean -f`

`npm i`

You should then be all set.

If that still doesn't work, refer to the [`node-gyp` npm package homepage](https://www.npmjs.com/package/node-gyp) for further instructions and contact the `node-gyp`team on [GitHub](https://github.com/nodejs/node-gyp/issues).

0 comments on commit 44901ad

Please sign in to comment.