Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update on Gatsby Windows instructions #1216

Merged
merged 1 commit into from
Jun 20, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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).