Gatsby: 'git' is not recognized as an internal or external command

Created on 17 Sep 2018  路  10Comments  路  Source: gatsbyjs/gatsby

Description

I'm trying to install Gatsby. I'm a designer and have not much cli experience. I followed the tutorial but it stopped working after the second command.

I already have Node and NPM installed (Windows 10). Installed Gatsby Globally. And entered the New Project Command

gatsby new hello-world https://github.com/gatsbyjs/gatsby-starter-hello-world#v2

Now, I'm getting this error:

info Creating new site from git: https://github.com/gatsbyjs/gatsby-starter-hello-world.git
'git' is not recognized as an internal or external command,
operable program or batch file.
error spawn git ENOENT

  Error: spawn git ENOENT

  - enoent.js:11 notFoundError
    [npm]/[gatsby-cli]/[cross-spawn]/lib/enoent.js:11:11

  - enoent.js:46 verifyENOENT
    [npm]/[gatsby-cli]/[cross-spawn]/lib/enoent.js:46:16

  - enoent.js:33 ChildProcess.cp.emit
    [npm]/[gatsby-cli]/[cross-spawn]/lib/enoent.js:33:19

  - child_process.js:198 Process.ChildProcess._handle.onexit
    internal/child_process.js:198:12

After few google search, they says Git is needed to be installed. I have not and its not mentioned in the docs or tutorial. Anyway, I installed it and I got the same issue so I uninstalled.

Also tried deactivating Antivirus / Firewall but no luck.

Steps to reproduce

Run this command

gatsby new hello-world https://github.com/gatsbyjs/gatsby-starter-hello-world#v2

Expected result

Should work normally

Actual result

Got error.

Environment

 System:
    OS: Windows 10
    CPU: x64 Intel(R) Core(TM) i5-4440 CPU @ 3.10GHz
  Binaries:
    npm: 5.6.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: 42.17134.1.0

error The system cannot find the path specified.



  Error: The system cannot find the path specified.

  - envinfo.js:1 Function.e.exports.sync
    [npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:7778

  - envinfo.js:1 Object.copySync
    [npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:104976

  - envinfo.js:1 Object.t.writeSync.e [as writeSync]
    [npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:123499

  - envinfo.js:1
    [npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:124274

  - envinfo.js:1 Promise.all.then.e
    [npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:124289

  - util.js:16 tryCatcher
    [npm]/[gatsby-cli]/[bluebird]/js/release/util.js:16:23

  - promise.js:512 Promise._settlePromiseFromHandler
    [npm]/[gatsby-cli]/[bluebird]/js/release/promise.js:512:31

  - promise.js:569 Promise._settlePromise
    [npm]/[gatsby-cli]/[bluebird]/js/release/promise.js:569:18

  - promise.js:614 Promise._settlePromise0
    [npm]/[gatsby-cli]/[bluebird]/js/release/promise.js:614:10

  - promise.js:694 Promise._settlePromises
    [npm]/[gatsby-cli]/[bluebird]/js/release/promise.js:694:18

  - promise.js:638 Promise._fulfill
    [npm]/[gatsby-cli]/[bluebird]/js/release/promise.js:638:18

  - promise_array.js:126 PromiseArray._resolve
    [npm]/[gatsby-cli]/[bluebird]/js/release/promise_array.js:126:19

  - promise_array.js:144 PromiseArray._promiseFulfilled
    [npm]/[gatsby-cli]/[bluebird]/js/release/promise_array.js:144:14

  - promise.js:574 Promise._settlePromise
    [npm]/[gatsby-cli]/[bluebird]/js/release/promise.js:574:26

  - promise.js:614 Promise._settlePromise0
    [npm]/[gatsby-cli]/[bluebird]/js/release/promise.js:614:10

  - promise.js:694 Promise._settlePromises
    [npm]/[gatsby-cli]/[bluebird]/js/release/promise.js:694:18


error UNHANDLED REJECTION


  Error: The system cannot find the path specified.

  - envinfo.js:1 Function.e.exports.sync
    [npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:7778

  - envinfo.js:1 Object.copySync
    [npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:104976

  - envinfo.js:1 Object.t.writeSync.e [as writeSync]
    [npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:123499

  - envinfo.js:1
    [npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:124274

  - envinfo.js:1 Promise.all.then.e
    [npm]/[gatsby-cli]/[envinfo]/dist/envinfo.js:1:124289

  - util.js:16 tryCatcher
    [npm]/[gatsby-cli]/[bluebird]/js/release/util.js:16:23

  - promise.js:512 Promise._settlePromiseFromHandler
    [npm]/[gatsby-cli]/[bluebird]/js/release/promise.js:512:31

  - promise.js:569 Promise._settlePromise
    [npm]/[gatsby-cli]/[bluebird]/js/release/promise.js:569:18

  - promise.js:614 Promise._settlePromise0
    [npm]/[gatsby-cli]/[bluebird]/js/release/promise.js:614:10

  - promise.js:694 Promise._settlePromises
    [npm]/[gatsby-cli]/[bluebird]/js/release/promise.js:694:18

  - promise.js:638 Promise._fulfill
    [npm]/[gatsby-cli]/[bluebird]/js/release/promise.js:638:18

  - promise_array.js:126 PromiseArray._resolve
    [npm]/[gatsby-cli]/[bluebird]/js/release/promise_array.js:126:19

  - promise_array.js:144 PromiseArray._promiseFulfilled
    [npm]/[gatsby-cli]/[bluebird]/js/release/promise_array.js:144:14

  - promise.js:574 Promise._settlePromise
    [npm]/[gatsby-cli]/[bluebird]/js/release/promise.js:574:26

  - promise.js:614 Promise._settlePromise0
    [npm]/[gatsby-cli]/[bluebird]/js/release/promise.js:614:10

  - promise.js:694 Promise._settlePromises
    [npm]/[gatsby-cli]/[bluebird]/js/release/promise.js:694:18
good first issue help wanted documentation

All 10 comments

@surjithctly You'll need git installed for the following command to run successfully:

gatsby new hello-world https://github.com/gatsbyjs/gatsby-starter-hello-world#v2

Please install git using this tutorial.

@kakadiadarpan As I mentioned, I also tried after installing Git. But getting same error.

I have tried again now but no luck.

Any further help?

@surjithctly Most likely did not add Git to your PATH environment variable. Please check this stackoverflow link for more help.

We'll be closing this issue as it is not Gatsby issue.

(Please reopen if you disagree 馃檪)

One Question: if Git is required and mandatory to start using Gatsby, Why is it not mentioned atleast once in Docs or Tutorial. It really helps the beginners.

What's your opinion @kakadiadarpan ?

Restarting the VSCode (Powershell) fixed the issue as told link given by you. Thanks :)

Still not sure I should Keep GIT or not since its not mentioned as pre-requisties.

@surjithctly Yes, Git should be mentioned as a dependency in the docs. Would you like to work on this and raise a PR?

You'll need to make changes in Get Started section here

Done #8215

Hello ! :smiley:

Is this issue addressed completely ? (just asking since it is in Open Status)

Closed by #8215

@kakadiadarpan
i have same issue but fixed it by your guides. thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

signalwerk picture signalwerk  路  3Comments

3CordGuy picture 3CordGuy  路  3Comments

rossPatton picture rossPatton  路  3Comments

kalinchernev picture kalinchernev  路  3Comments