gpt4 book ai didi

node.js - Gatsby 默认启动器

转载 作者:行者123 更新时间:2023-12-04 07:36:04 27 4
gpt4 key购买 nike

当我创建 gatsby-default-starter 时出现此错误地点。如何解决。它有什么问题?
错误信息:

‼ pngquant pre-build test failed i compiling from source × Error: pngquant failed to build, make sure that libpng-dev is installed at D:\gatsby-project\my-gatsby-project\node_modules\bin-build\node_modules\execa\index.js:231:11 at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:93:5) at async Promise.all (index 0) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\webpack-dev-server\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! pngquant-bin@6.0.0 postinstall: node lib/install.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the pngquant-bin@6.0.0 postinstall 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:

ERROR

Command failed with exit code 1: npm install

Error: Command failed with exit code 1: npm install

error.js:56 makeError [npm]/[gatsby-cli]/[execa]/lib/error.js:56:11

index.js:114 handlePromise [npm]/[gatsby-cli]/[execa]/index.js:114:26

task_queues.js:93 processTicksAndRejections internal/process/task_queues.js:93:5

init-starter.js:135 install [npm]/[gatsby-cli]/lib/init-starter.js:135:7

init-starter.js:202 clone [npm]/[gatsby-cli]/lib/init-starter.js:202:3

init-starter.js:343 initStarter [npm]/[gatsby-cli]/lib/init-starter.js:343:5

create-cli.js:494 [npm]/[gatsby-cli]/lib/create-cli.js:494:9

最佳答案

您似乎正在使用 Windows 作为操作系统。此问题通常与您可能需要的一些其他依赖项有关。请尝试以下操作:

  • 删除您的项目(以避免可能损坏的依赖项)。
  • 安装 windows-build-tools 经过:
    npm install --global windows-build-tools --vs2015
  • 运行您的启动命令并开发它。例如:
    npm install -g gatsby-cli

    gatsby new gatsby-site

    cd gatsby-site

    gatsby develop
  • 如果问题仍然存在,请尝试通过以下方式手动安装缺少的依赖项:
    npm install imagemin-pngquant@5.0.1 --save

    npm install pngquant-bin@3.1.1 --save

  • 更多详情请查看 Gatsby on Windows docs .

    关于node.js - Gatsby 默认启动器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67734980/

    27 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com