克隆git存储库时,gatsby开发失败

时间:2020-08-29 08:36:20

标签: reactjs git gatsby gatsby-plugin

当我创建新项目并执行以下步骤时,我的gatsby项目可以完美运行:https://www.gatsbyjs.com/docs/quick-start/但是,当我尝试克隆另一个存储库时,例如:

  1. git clone https:// repositoryurl
  2. npm install -g gatsby-cli
  3. npm安装
  4. gatsby开发

它失败并显示错误Failed at the pngquant-bin@5.0.2 postinstall script.,我尝试了不同的存储库,这些解决方案是我在Internet上找到的所有解决方案,但无济于事。在您要求运行npm install libpng-dev之前,请给出npm ERR! 404 Not Found - GET https://registry.npmjs.org/libpng-dev - Not found。运行npm install pngquant-bin得到npm ERR! pngquant-bin@6.0.0 postinstall node lib/install.js我的节点版本:v12.18.3。我的npm版本:6.14.6。我使用Windows 10

1 个答案:

答案 0 :(得分:1)

您需要安装Hibernate Types GitHub repository。只需运行:

npm install --global windows-build-tools --vs2015

许多Gatsby插件和主题都需要构建本机Node.js模块,例如Sharp(一种用于图像处理的常见Gatsby依赖项,就像破坏代码的那种依赖项)。安装此软件包后,它将下载并安装Microsoft免费提供的Visual C ++ Build Tools 2015。这些工具是编译流行的本机模块所必需的。它还将安装Python 2.7,配置您的计算机,并适当地配置npm。