2

[已解决]
当我尝试创建一个新的 gatsby 站点(使用gatsby new或启动器)或尝试使用 yarn 为现有站点安装依赖项时,我总是收到以下错误:

⚠ write EPROTO 4403060160:error:1408F10B:SSL  
routines:ssl3_get_record:wrong version  
number:../deps/openssl/openssl/ssl/record/ssl3_record.c:332:  
 
⚠ pngquant pre-build test failed  
ℹ compiling from source  
✖ Error: pngquant failed to build, make sure that libpng is installed  
at /Users/path_to_project/node_modules/bin-build/node_modules/execa/index.js:231:11  
at runMicrotasks (<anonymous>)

我已经libpng安装在我的系统(macos)上。我该如何解决我的问题?

 System:
    OS: macOS 10.15.5
    CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.18.1 - ~/.nvm/versions/node/v12.18.1/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.5 - ~/.nvm/versions/node/v12.18.1/bin/npm
  Languages:
    Python: 2.7.16 - /Users/user/.pyenv/shims/python
  Browsers:
    Chrome: 83.0.4103.116
    Firefox: 77.0.1
    Safari: 13.1.1
  npmPackages:
    gatsby: ^2.21.22 => 2.24.2
    gatsby-image: ^2.4.3 => 2.4.13
    gatsby-plugin-emotion: ^4.3.3 => 4.3.10
    gatsby-plugin-manifest: ^2.4.2 => 2.4.18
    gatsby-plugin-offline: ^3.2.1 => 3.2.17
    gatsby-plugin-react-helmet: ^3.3.1 => 3.3.10
    gatsby-plugin-sharp: ^2.6.2 => 2.6.19
    gatsby-source-filesystem: ^2.3.1 => 2.3.19
    gatsby-source-graphql: ^2.5.2 => 2.6.2
    gatsby-transformer-sharp: ^2.5.2 => 2.5.11
4

1 回答 1

1

我确实跑brew install pkg-config了,它解决了这个问题。更多信息:https ://github.com/gatsbyjs/gatsby/issues/20389

于 2020-07-10T16:14:07.193 回答