首页 > 解决方案 > 安装 gatsby-rehype-in​​line-images 包时如何解决 NPM 安装错误

问题描述

我正在尝试在本地设置 ghost cms,在将包添加到项目时收到错误消息。使用 Jamify 提供的主题进行此 ghost cms 安装过程

我尝试使用 npm cache clean --force 清除缓存,但仍然无效

C:\Users\RajatDas\ghost-local\jamify-starter>yarn add gatsby-rehype-inline-images
yarn add v1.22.10
[1/4] Resolving packages...
info There appears to be trouble with your network connection. Retrying...
[2/4] Fetching packages...
info fsevents@2.1.3: The platform "win32" is incompatible with this module.
info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@1.2.13: The platform "win32" is incompatible with this module.
info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > gatsby@2.27.0" has incorrect peer dependency "react@^16.4.2".
warning " > gatsby@2.27.0" has incorrect peer dependency "react-dom@^16.4.2".
warning "gatsby > @reach/router@1.3.4" has incorrect peer dependency "react@15.x || 16.x || 16.4.0-alpha.0911da3".
warning "gatsby > @reach/router@1.3.4" has incorrect peer dependency "react-dom@15.x || 16.x || 16.4.0-alpha.0911da3".
warning "gatsby > gatsby-link@2.6.0" has incorrect peer dependency "react@^16.4.2".
warning "gatsby > gatsby-link@2.6.0" has incorrect peer dependency "react-dom@^16.4.2".
warning "gatsby > gatsby-react-router-scroll@3.2.0" has incorrect peer dependency "react@^16.4.2".
warning "gatsby > gatsby-react-router-scroll@3.2.0" has incorrect peer dependency "react-dom@^16.4.2".
warning "gatsby > @reach/router > create-react-context@0.3.0" has incorrect peer dependency "react@^0.14.0 || ^15.0.0 || ^16.0.0".
warning "gatsby > @typescript-eslint/eslint-plugin > tsutils@3.17.1" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
warning "gatsby > eslint-plugin-graphql > graphql-config > @endemolshinegroup/cosmiconfig-typescript-loader > ts-node@9.0.0" has unmet peer dependency "typescript@>=2.7".
warning "gatsby-plugin-netlify > webpack-assets-manifest@3.1.1" has unmet peer dependency "webpack@>=4.4.0".
warning "gatsby-plugin-preact > @prefresh/webpack@1.1.0" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
warning "gatsby-theme-ghost-members > styled-components@5.2.1" has unmet peer dependency "react-is@>= 16.8.0".
warning "gatsby-theme-try-ghost > gatsby-background-image@1.3.1" has incorrect peer dependency "react@16.x".
warning "gatsby-theme-try-ghost > gatsby-background-image@1.3.1" has incorrect peer dependency "react-dom@16.x".
warning "gatsby-theme-try-ghost > gatsby-plugin-postcss@3.4.0" has unmet peer dependency "postcss@^8.0.5".
warning "gatsby-theme-try-ghost > gatsby-plugin-postcss > postcss-loader@4.1.0" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
warning "gatsby-theme-try-ghost > gatsby-plugin-postcss > postcss-loader@4.1.0" has unmet peer dependency "postcss@^7.0.0 || ^8.0.1".
warning " > gatsby-rehype-inline-images@1.9.3" has incorrect peer dependency "gatsby-transformer-rehype@1.9.7".
[4/4] Building fresh packages...
[10/13] ⡀ mozjpeg
[-/13] ⡀ waiting...
[-/13] ⡀ waiting...
[-/13] ⡀ waiting...
error C:\Users\RajatDas\ghost-local\jamify-starter\node_modules\mozjpeg: Command failed.
Exit code: 1
Command: node lib/install.js
Arguments:
Directory: C:\Users\RajatDas\ghost-local\jamify-starter\node_modules\mozjpeg
Output:
‼ getaddrinfo ENOTFOUND raw.githubusercontent.com
  ‼ mozjpeg pre-build test failed
  i compiling from source
  × Error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c "autoreconf -fiv"
'autoreconf' is not recognized as an internal or external command,
operable program or batch file.


    at C:\Users\RajatDas\ghost-local\jamify-starter\node_modules\bin-build\node_modules\execa\index.js:231:11

无法弄清楚如何解决它。我正在关注Jamify的指南

标签: node.jsnpmnpm-installyarnpkgnpm-scripts

解决方案


推荐阅读