From ca83af533c0c6a090fa8158f98796b23725ad5ec Mon Sep 17 00:00:00 2001 From: sebastienfi Date: Tue, 20 Jun 2017 22:03:23 +0200 Subject: [PATCH] Update on Gatsby Windows instructions After solving this myself --- docs/docs/gatsby-on-windows.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docs/docs/gatsby-on-windows.md b/docs/docs/gatsby-on-windows.md index 29c6e3e8cb1a4..0de6443739364 100644 --- a/docs/docs/gatsby-on-windows.md +++ b/docs/docs/gatsby-on-windows.md @@ -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).