首页 > 解决方案 > 使用 gatsby 创建新项目的命令不起作用

问题描述

我正在创建一个名为“new-app”的项目。成功安装 gatsby 后,我尝试运行命令“gatsby new my-app”。我总是收到一个错误,其中指出:

从 git 吃新网站时出错: https ://github.com/gatsbyjs/gatsby-starter-default.git

命令失败,退出代码 2 (ENOENT):git clone https://github.com/gatsbyjs/gatsby-starter-default.git my-app --single-branch spawn git ENOENT

错误:命令失败,退出代码 2(ENOENT):git clone https://github.com/gatsbyjs/gatsby-starter-default.git my-app --single-branch spawn git ENOENT

  • enoent.js:6 notFoundError [npm]/[gatsby-cli]/[cross-spawn]/lib/enoent.js:6:26

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

  • enoent.js:27 ChildProcess.cp.emit [npm]/[gatsby-cli]/[cross-spawn]/lib/enoent.js:27:25

  • child_process.js:248 Process.ChildProcess._handle.onexit internal/child_process.js:248:12

标签: gatsby

解决方案


我自己也遇到了这个。上周我擦了笔记本电脑,完全忘记了安装 git。问题解决了(无论如何,对我来说,希望对你也一样!)


推荐阅读