Gatsby: Gatsby starter install error in WIndows 10

Created on 30 Jul 2017  路  13Comments  路  Source: gatsbyjs/gatsby

Hi, tried several times to install some of the Gatsby starters and get the same error

I have python installed and set in my env variables, I'm guessing it's something on my machine if no one else is having this issue

Does anyone have any pointers?

Thanks

Apologies for the error output below

2017-07-30T08:41:34+0100 <error> new.js:12 () Error: gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "C:\Python36\python.EXE", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Windows_NT 10.0.15063
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\spenc\gitrepos\blog\node_modules\sharp
gyp ERR! node -v v8.2.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\spenc\AppData\Roaming\npm-cache\_logs\2017-07-30T07_41_34_231Z-debug.log

    at C:\Users\spenc\AppData\Roaming\npm\node_modules\gatsby\dist\utils\init-starter.js:56:16
    at ChildProcess.exithandler (child_process.js:277:5)
    at emitTwo (events.js:125:13)
    at ChildProcess.emit (events.js:213:7)
    at maybeClose (internal/child_process.js:921:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)

Most helpful comment

A larger thought, maybe its worth leaving any plugin with a native dep out of the default starter, just to avoid this tension for windows folks. Setting up the dang build env correctly cna be a chore (and time intensive) it'd be good to avoid for the default starter.

All 13 comments

Check this and especially the second part that I updated a few days ago.
https://www.gatsbyjs.org/docs/gatsby-on-windows/

Also try to reinstall Python 2.7 and during install process check the "Add Python to path". Also it fails if Python is in %ProgramFiles%, better installed at C:\Python\

Hey @sebastienfi I'll check out the link thanks. Python is installed in the location C:\Python\ on my machine

It says it can't find Can't find Python executable "C:\Python36\python.EXE". I'd confirm that your path matches your installed location. Also I'm presuming you have Python 3 installed, and it seems like that is being used instead.

A larger thought, maybe its worth leaving any plugin with a native dep out of the default starter, just to avoid this tension for windows folks. Setting up the dang build env correctly cna be a chore (and time intensive) it'd be good to avoid for the default starter.

Use Python 2.7 not Python 3.

This is resolved now, thank you 馃憤

I only needed the install of windows-build-tools

@spences10 this was on the gatsby-blog-starter?

@jquense generally agree with you (and the default starter doesn't have native dependencies) but it's nice too to show off more advanced functionality. Perhaps we can add an automated check for windows-build-tools or something in the future.

Forgive me @KyleAMathews I can't remember, it wasn't from the github.com/gatsbyjs org but I think it was from the documentation.

Hello, I'm having a similar issue with node-gyp again

Apologies for this, I tried npm -g i windows-build-tools again but kept getting the error

I have recently tried to use Windows Subsystem Linux for terminal and I'm not sure if that has messed anything up now

Here are gists of terminal output from both cmder and hyper, hyper being in WSL using zsh

cmder: https://gist.github.com/anonymous/3fe6e471bfa98eae5ec114fad71d87f8

zsh: https://gist.github.com/anonymous/1f93efab89781e523ff07dbe8fcbcb15

https://dl.bintray.com/lovell/sharp/libvips-8.4.2-win32-x64.tar.gz

sharp is not available atm.

https://github.com/lovell/sharp/issues/964

Ok, happy to close this and watch the linked issue

Thanks @trung674 馃憤

I had the same issue on Windows 10. It took me a couple of days to fix. I tried all the suggestions on Gatsby's docs, such as installing the build tools and even installing the C library. I also always deleted the sharp library on every attempt. I solved this by simply upgrading NodeJs from v9+ to v10+.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hobochild picture hobochild  路  3Comments

rossPatton picture rossPatton  路  3Comments

andykais picture andykais  路  3Comments

theduke picture theduke  路  3Comments

magicly picture magicly  路  3Comments