解决前端安装sharp出错问题sharp: Command failed.
报错如下:sharp: Command failed.
cd C:\Users\xxx-api && yarn install
yarn install v1.22.19un\Documents\my_files\A-Web-Project\service-categories\service-categories-api> cd .\service-categories-api\
info No lockfile found.
[1/5] Validating package.json...
[2/5] Resolving packages...
warning @strapi/strapi > koa-body > formidable@1.2.6: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau
warning @strapi/strapi > @strapi/plugin-email > @strapi/provider-email-sendmail > sendmail > mailcomposer@3.12.0: This project is unmaintained
warning @strapi/strapi > @strapi/plugin-email > @strapi/provider-email-sendmail > sendmail > mailcomposer > buildmail@3.10.0: This project is unmaintained
warning @strapi/strapi > @strapi/generators > plop > liftoff > findup-sync > micromatch > snapdragon > source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
warning @strapi/strapi > @strapi/generators > plop > liftoff > findup-sync > micromatch > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
warning @strapi/strapi > @strapi/generators > plop > liftoff > findup-sync > micromatch > snapdragon > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
warning @strapi/strapi > @strapi/generators > plop > liftoff > findup-sync > micromatch > snapdragon > source-map-resolve > source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
[3/5] Fetching packages...
[4/5] Linking dependencies...
warning "@strapi/strapi > @strapi/plugin-email@4.9.0" has unmet peer dependency "react@^17.0.2".
warning "@strapi/strapi > @strapi/plugin-email@4.9.0" has unmet peer dependency "react-dom@^17.0.2".
warning "@strapi/strapi > @strapi/plugin-email@4.9.0" has unmet peer dependency "react-router-dom@5.3.4".
warning "@strapi/strapi > @strapi/plugin-email@4.9.0" has unmet peer dependency "styled-components@5.3.3".
warning "@strapi/strapi > @strapi/plugin-content-type-builder@4.9.0" has unmet peer dependency "react@^17.0.2".
warning "@strapi/strapi > @strapi/plugin-content-type-builder@4.9.0" has unmet peer dependency "react-dom@^17.0.2".
warning "@strapi/strapi > @strapi/plugin-content-type-builder@4.9.0" has unmet peer dependency "react-router-dom@5.3.4".
warning "@strapi/strapi > @strapi/plugin-content-type-builder@4.9.0" has unmet peer dependency "styled-components@5.3.3".
warning "@strapi/strapi > @strapi/plugin-upload@4.9.0" has unmet peer dependency "react@^17.0.2".
warning "@strapi/strapi > @strapi/plugin-upload@4.9.0" has unmet peer dependency "react-dom@^17.0.2".
warning "@strapi/strapi > @strapi/plugin-upload@4.9.0" has unmet peer dependency "react-router-dom@5.3.4".
warning "@strapi/strapi > @strapi/plugin-upload@4.9.0" has unmet peer dependency "styled-components@5.3.3".
warning "@strapi/plugin-users-permissions > @strapi/design-system@1.6.6" has unmet peer dependency "react@^17.0.1".
warning "@strapi/plugin-users-permissions > @strapi/design-system@1.6.6" has unmet peer dependency "react-dom@^17.0.1".
warning "@strapi/plugin-users-permissions > @strapi/design-system@1.6.6" has unmet peer dependency "react-router-dom@^5.2.0".
warning "@strapi/plugin-users-permissions > @strapi/design-system@1.6.6" has unmet peer dependency "styled-components@^5.2.1".
warning "@strapi/plugin-users-permissions > @strapi/helper-plugin@4.9.0" has unmet peer dependency "react@^17.0.2".
warning "@strapi/plugin-users-permissions > @strapi/helper-plugin@4.9.0" has unmet peer dependency "react-dom@^17.0.2".
warning "@strapi/plugin-users-permissions > @strapi/helper-plugin@4.9.0" has unmet peer dependency "react-router-dom@5.3.4".
warning "@strapi/plugin-users-permissions > @strapi/helper-plugin@4.9.0" has unmet peer dependency "styled-components@5.3.3".
warning "@strapi/plugin-users-permissions > @strapi/icons@1.6.6" has unmet peer dependency "react@^17.0.2".
warning "@strapi/plugin-users-permissions > @strapi/icons@1.6.6" has unmet peer dependency "react-dom@^17.0.2".
warning "@strapi/plugin-users-permissions > formik@2.2.9" has unmet peer dependency "react@>=16.8.0".
warning "@strapi/plugin-users-permissions > react-intl@6.3.2" has unmet peer dependency "react@^16.6.0 || 17 || 18".
warning "@strapi/plugin-users-permissions > react-query@3.24.3" has unmet peer dependency "react@^16.8.0 || ^17.0.0".
warning "@strapi/plugin-users-permissions > react-redux@8.0.5" has unmet peer dependency "react@^16.8 || ^17.0 || ^18.0".
warning "@strapi/strapi > @strapi/admin > @strapi/design-system > @uiw/react-codemirror@4.19.11" has unmet peer dependency "@codemirror/state@>=6.0.0".
warning "@strapi/strapi > @strapi/admin > @strapi/design-system > @uiw/react-codemirror@4.19.11" has unmet peer dependency "@codemirror/theme-one-dark@>=6.0.0".
warning "@strapi/strapi > @strapi/admin > @strapi/design-system > @uiw/react-codemirror@4.19.11" has unmet peer dependency "@codemirror/view@>=6.0.0".
warning "@strapi/strapi > @strapi/admin > @strapi/design-system > @uiw/react-codemirror@4.19.11" has unmet peer dependency "codemirror@>=6.0.0".
warning "@strapi/strapi > @strapi/admin > @strapi/design-system > @uiw/react-codemirror > @uiw/codemirror-extensions-basic-setup@4.19.11" has unmet peer dependency "@codemirror/autocomplete@>=6.0.0".
warning "@strapi/strapi > @strapi/admin > @strapi/design-system > @uiw/react-codemirror > @uiw/codemirror-extensions-basic-setup@4.19.11" has unmet peer dependency "@codemirror/language@>=6.0.0".
warning "@strapi/strapi > @strapi/admin > @strapi/design-system > @uiw/react-codemirror > @uiw/codemirror-extensions-basic-setup@4.19.11" has unmet peer dependency "@codemirror/lint@>=6.0.0".
warning "@strapi/strapi > @strapi/admin > @strapi/design-system > @uiw/react-codemirror > @uiw/codemirror-extensions-basic-setup@4.19.11" has unmet peer dependency "@codemirror/search@>=6.0.0".warning "@strapi/strapi > @strapi/admin > @strapi/design-system > @uiw/react-codemirror > @uiw/codemirror-extensions-basic-setup@4.19.11" has unmet peer dependency "@codemirror/view@>=6.0.0".
warning "@strapi/strapi > @strapi/admin > @strapi/design-system > @uiw/react-codemirror > codemirror > @codemirror/autocomplete@6.4.2" has unmet peer dependency "@lezer/common@^1.0.0".
warning " > @strapi/plugin-users-permissions@4.9.0" has unmet peer dependency "react@^17.0.2".
warning " > @strapi/plugin-users-permissions@4.9.0" has unmet peer dependency "react-dom@^17.0.2".
warning " > @strapi/plugin-users-permissions@4.9.0" has unmet peer dependency "react-router-dom@5.3.4".
warning " > @strapi/plugin-users-permissions@4.9.0" has unmet peer dependency "styled-components@5.3.3".
warning " > @strapi/plugin-i18n@4.9.0" has unmet peer dependency "react@^17.0.2".
warning " > @strapi/plugin-i18n@4.9.0" has unmet peer dependency "react-dom@^17.0.2".
warning " > @strapi/plugin-i18n@4.9.0" has unmet peer dependency "react-router-dom@5.3.4".
warning " > @strapi/plugin-i18n@4.9.0" has unmet peer dependency "styled-components@5.3.3".
[5/5] Building fresh packages...
[-/5] ⠄ waiting...
[-/5] ⡀ waiting...
[3/5] ⡀ sharp
[-/5] ⡀ waiting...
error C:\Users\xxx-api\node_modules\sharp: Command failed.
Exit code: 1
Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
Arguments:
Directory: C:\Users\xxx-api\node_modules\sharp
Output:
PS C:\Users\xxx-api> node install/libvips && node install/dll-copy && prebuild-install
At line:1 char:22
+ node install/libvips && node install/dll-copy && prebuild-install
+ ~~
The token '&&' is not a valid statement separator in this version.
At line:1 char:47
+ node install/libvips && node install/dll-copy && prebuild-install
+ ~~
The token '&&' is not a valid statement separator in this version.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : InvalidEndOfLine
PS C:\Users\xxx-api> npm config set sharp_binary_host "https://npm.taobao.org/mirrors/sharp"
PS C:\Users\xxx-api> npm config set sharp_libvips_binary_host "https://npm.taobao.org/mirrors/sharp-libvips"
PS C:\Users\xxx-api> npm install sharp
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: styled-components@5.3.3
npm WARN Found: react-is@17.0.2
npm WARN node_modules/styled-components/node_modules/react-is
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react-is@">= 16.8.0" from styled-components@5.3.3
npm WARN node_modules/styled-components
npm WARN peer styled-components@">= 2" from babel-plugin-styled-components@2.1.1
npm WARN node_modules/styled-components/node_modules/babel-plugin-styled-components
npm WARN 8 more (babel-plugin-styled-components, ...)
npm ERR! code 1
npm ERR! path C:\Users\xxx-api\node_modules\sharp
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
npm ERR! sharp: Downloading https://npm.taobao.org/mirrors/sharp-libvips/v8.14.2/libvips-8.14.2-win32-x64.tar.br
npm ERR! sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies
npm ERR! sharp: Installation error: self signed certificate in certificate chain
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Jindi J Sun\AppData\Local\npm-cache\_logs\2023-04-07T07_39_48_839Z-debug-0.log
PS C:\Users\xxx-api> yarn config set sharp_binary_host "https://npm.taobao.org/mirrors/sharp"
yarn config v1.22.19
success Set "sharp_binary_host" to "https://npm.taobao.org/mirrors/sharp".
Done in 0.06s.
PS C:\Users\xxx-api> yarn config set sharp_libvips_binary_host "https://npm.taobao.org/mirrors/sharp-libvips"
yarn config v1.22.19
success Set "sharp_libvips_binary_host" to "https://npm.taobao.org/mirrors/sharp-libvips".
Done in 0.06s.
PS C:\Users\xxx-api> yarn add sharp
yarn add v1.22.19
info No lockfile found.
[1/5] Validating package.json...
[2/5] Resolving packages...
warning @strapi/strapi > koa-body > formidable@1.2.6: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau
warning @strapi/strapi > @strapi/plugin-email > @strapi/provider-email-sendmail > sendmail > mailcomposer@3.12.0: This project is unmaintained
warning @strapi/strapi > @strapi/plugin-email > @strapi/provider-email-sendmail > sendmail > mailcomposer > buildmail@3.10.0: This project is unmaintained
warning @strapi/strapi > @strapi/generators > plop > liftoff > findup-sync > micromatch > snapdragon > source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
warning @strapi/strapi > @strapi/generators > plop > liftoff > findup-sync > micromatch > snapdragon > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
warning @strapi/strapi > @strapi/generators > plop > liftoff > findup-sync > micromatch > snapdragon > source-map-resolve > source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
warning @strapi/strapi > @strapi/generators > plop > liftoff > findup-sync > micromatch > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
[3/5] Fetching packages...
[4/5] Linking dependencies...
warning "@strapi/strapi > @strapi/plugin-content-type-builder@4.9.0" has unmet peer dependency "react@^17.0.2".
warning "@strapi/strapi > @strapi/plugin-content-type-builder@4.9.0" has unmet peer dependency "react-dom@^17.0.2".
warning "@strapi/strapi > @strapi/plugin-content-type-builder@4.9.0" has unmet peer dependency "react-router-dom@5.3.4".
warning "@strapi/strapi > @strapi/plugin-content-type-builder@4.9.0" has unmet peer dependency "styled-components@5.3.3".
warning "@strapi/strapi > @strapi/plugin-email@4.9.0" has unmet peer dependency "react@^17.0.2".
warning "@strapi/strapi > @strapi/plugin-email@4.9.0" has unmet peer dependency "react-dom@^17.0.2".
warning "@strapi/strapi > @strapi/plugin-email@4.9.0" has unmet peer dependency "react-router-dom@5.3.4".
warning "@strapi/strapi > @strapi/plugin-email@4.9.0" has unmet peer dependency "styled-components@5.3.3".
warning "@strapi/strapi > @strapi/plugin-upload@4.9.0" has unmet peer dependency "react@^17.0.2".
warning "@strapi/strapi > @strapi/plugin-upload@4.9.0" has unmet peer dependency "react-dom@^17.0.2".
warning "@strapi/strapi > @strapi/plugin-upload@4.9.0" has unmet peer dependency "react-router-dom@5.3.4".
warning "@strapi/strapi > @strapi/plugin-upload@4.9.0" has unmet peer dependency "styled-components@5.3.3".
warning "@strapi/plugin-users-permissions > @strapi/design-system@1.6.6" has unmet peer dependency "react@^17.0.1".
warning "@strapi/plugin-users-permissions > @strapi/design-system@1.6.6" has unmet peer dependency "react-dom@^17.0.1".
warning "@strapi/plugin-users-permissions > @strapi/design-system@1.6.6" has unmet peer dependency "react-router-dom@^5.2.0".
warning "@strapi/plugin-users-permissions > @strapi/design-system@1.6.6" has unmet peer dependency "styled-components@^5.2.1".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > react-helmet@6.1.0" has unmet peer dependency "react@>=16.3.0".
warning "@strapi/plugin-users-permissions > @strapi/icons@1.6.6" has unmet peer dependency "react@^17.0.2".
warning "@strapi/plugin-users-permissions > @strapi/icons@1.6.6" has unmet peer dependency "react-dom@^17.0.2".
warning "@strapi/plugin-users-permissions > @strapi/helper-plugin@4.9.0" has unmet peer dependency "react@^17.0.2".
warning "@strapi/plugin-users-permissions > @strapi/helper-plugin@4.9.0" has unmet peer dependency "react-dom@^17.0.2".
warning "@strapi/plugin-users-permissions > @strapi/helper-plugin@4.9.0" has unmet peer dependency "react-router-dom@5.3.4".
warning "@strapi/plugin-users-permissions > @strapi/helper-plugin@4.9.0" has unmet peer dependency "styled-components@5.3.3".
warning "@strapi/plugin-users-permissions > react-redux@8.0.5" has unmet peer dependency "react@^16.8 || ^17.0 || ^18.0".
warning "@strapi/plugin-users-permissions > react-intl@6.3.2" has unmet peer dependency "react@^16.6.0 || 17 || 18".
warning "@strapi/plugin-users-permissions > formik@2.2.9" has unmet peer dependency "react@>=16.8.0".
warning "@strapi/plugin-users-permissions > react-query@3.24.3" has unmet peer dependency "react@^16.8.0 || ^17.0.0".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > @strapi/design-system > @floating-ui/react-dom@1.3.0" has unmet peer dependency "react@>=16.8.0".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > @strapi/design-system > @floating-ui/react-dom@1.3.0" has unmet peer dependency "react-dom@>=16.8.0".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > @strapi/design-system > @uiw/react-codemirror@4.19.11" has unmet peer dependency "@babel/runtime@>=7.11.0".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > @strapi/design-system > @uiw/react-codemirror@4.19.11" has unmet peer dependency "@codemirror/state@>=6.0.0".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > @strapi/design-system > @uiw/react-codemirror@4.19.11" has unmet peer dependency "@codemirror/theme-one-dark@>=6.0.0".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > @strapi/design-system > @uiw/react-codemirror@4.19.11" has unmet peer dependency "@codemirror/view@>=6.0.0".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > @strapi/design-system > @uiw/react-codemirror@4.19.11" has unmet peer dependency "codemirror@>=6.0.0".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > @strapi/design-system > @uiw/react-codemirror@4.19.11" has unmet peer dependency "react@>=16.8.0".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > @strapi/design-system > @uiw/react-codemirror@4.19.11" has unmet peer dependency "react-dom@>=16.8.0".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > @strapi/design-system > @radix-ui/react-use-callback-ref@1.0.0" has unmet peer dependency "react@^16.8 || ^17.0 || ^18.0".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > react-helmet > react-side-effect@2.1.2" has unmet peer dependency "react@^16.3.0 || ^17.0.0 || ^18.0.0".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > react-redux > use-sync-external-store@1.2.0" has unmet peer dependency "react@^16.8.0 || ^17.0.0 || ^18.0.0".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > @strapi/design-system > @uiw/react-codemirror > @uiw/codemirror-extensions-basic-setup@4.19.11" has unmet peer dependency "@codemirror/autocomplete@>=6.0.0".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > @strapi/design-system > @uiw/react-codemirror > @uiw/codemirror-extensions-basic-setup@4.19.11" has unmet peer dependency "@codemirror/language@>=6.0.0".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > @strapi/design-system > @uiw/react-codemirror > @uiw/codemirror-extensions-basic-setup@4.19.11" has unmet peer dependency "@codemirror/lint@>=6.0.0".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > @strapi/design-system > @uiw/react-codemirror > @uiw/codemirror-extensions-basic-setup@4.19.11" has unmet peer dependency "@codemirror/search@>=6.0.0".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > @strapi/design-system > @uiw/react-codemirror > @uiw/codemirror-extensions-basic-setup@4.19.11" has unmet peer dependency "@codemirror/view@>=6.0.0".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > @strapi/design-system > @uiw/react-codemirror > codemirror > @codemirror/autocomplete@6.4.2" has unmet peer dependency "@lezer/common@^1.0.0".
warning " > @strapi/plugin-users-permissions@4.9.0" has unmet peer dependency "react@^17.0.2".
warning " > @strapi/plugin-users-permissions@4.9.0" has unmet peer dependency "react-dom@^17.0.2".
warning " > @strapi/plugin-users-permissions@4.9.0" has unmet peer dependency "react-router-dom@5.3.4".
warning " > @strapi/plugin-users-permissions@4.9.0" has unmet peer dependency "styled-components@5.3.3".
warning " > @strapi/plugin-i18n@4.9.0" has unmet peer dependency "react@^17.0.2".
warning " > @strapi/plugin-i18n@4.9.0" has unmet peer dependency "react-dom@^17.0.2".
warning " > @strapi/plugin-i18n@4.9.0" has unmet peer dependency "react-router-dom@5.3.4".
warning " > @strapi/plugin-i18n@4.9.0" has unmet peer dependency "styled-components@5.3.3".
[5/5] Building fresh packages...
[-/6] ⡀ waiting...
[6/6] ⡀ sharp
[3/6] ⡀ sharp
[-/6] ⢀ waiting...
error C:\Users\xxx-api\node_modules\@strapi\plugin-upload\node_modules\sharp: Command failed.
Exit code: 1
Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
Arguments:
Directory: C:\Users\xxx-api\node_modules\@strapi\plugin-upload\node_modules\sharp
Output:
PS C:cd C:\Users\xxx-api && yarn install
yarn install v1.22.19un\Documents\my_files\A-Web-Project\service-categories\service-categories-api> cd .\service-categories-api\
info No lockfile found.
[1/5] Validating package.json...
[2/5] Resolving packages...
warning @strapi/strapi > koa-body > formidable@1.2.6: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau
warning @strapi/strapi > @strapi/plugin-email > @strapi/provider-email-sendmail > sendmail > mailcomposer@3.12.0: This project is unmaintained
warning @strapi/strapi > @strapi/plugin-email > @strapi/provider-email-sendmail > sendmail > mailcomposer > buildmail@3.10.0: This project is unmaintained
warning @strapi/strapi > @strapi/generators > plop > liftoff > findup-sync > micromatch > snapdragon > source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
warning @strapi/strapi > @strapi/generators > plop > liftoff > findup-sync > micromatch > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
warning @strapi/strapi > @strapi/generators > plop > liftoff > findup-sync > micromatch > snapdragon > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
warning @strapi/strapi > @strapi/generators > plop > liftoff > findup-sync > micromatch > snapdragon > source-map-resolve > source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
[3/5] Fetching packages...
[4/5] Linking dependencies...
warning "@strapi/strapi > @strapi/plugin-email@4.9.0" has unmet peer dependency "react@^17.0.2".
warning "@strapi/strapi > @strapi/plugin-email@4.9.0" has unmet peer dependency "react-dom@^17.0.2".
warning "@strapi/strapi > @strapi/plugin-email@4.9.0" has unmet peer dependency "react-router-dom@5.3.4".
warning "@strapi/strapi > @strapi/plugin-email@4.9.0" has unmet peer dependency "styled-components@5.3.3".
warning "@strapi/strapi > @strapi/plugin-content-type-builder@4.9.0" has unmet peer dependency "react@^17.0.2".
warning "@strapi/strapi > @strapi/plugin-content-type-builder@4.9.0" has unmet peer dependency "react-dom@^17.0.2".
warning "@strapi/strapi > @strapi/plugin-content-type-builder@4.9.0" has unmet peer dependency "react-router-dom@5.3.4".
warning "@strapi/strapi > @strapi/plugin-content-type-builder@4.9.0" has unmet peer dependency "styled-components@5.3.3".
warning "@strapi/strapi > @strapi/plugin-upload@4.9.0" has unmet peer dependency "react@^17.0.2".
warning "@strapi/strapi > @strapi/plugin-upload@4.9.0" has unmet peer dependency "react-dom@^17.0.2".
warning "@strapi/strapi > @strapi/plugin-upload@4.9.0" has unmet peer dependency "react-router-dom@5.3.4".
warning "@strapi/strapi > @strapi/plugin-upload@4.9.0" has unmet peer dependency "styled-components@5.3.3".
warning "@strapi/plugin-users-permissions > @strapi/design-system@1.6.6" has unmet peer dependency "react@^17.0.1".
warning "@strapi/plugin-users-permissions > @strapi/design-system@1.6.6" has unmet peer dependency "react-dom@^17.0.1".
warning "@strapi/plugin-users-permissions > @strapi/design-system@1.6.6" has unmet peer dependency "react-router-dom@^5.2.0".
warning "@strapi/plugin-users-permissions > @strapi/design-system@1.6.6" has unmet peer dependency "styled-components@^5.2.1".
warning "@strapi/plugin-users-permissions > @strapi/helper-plugin@4.9.0" has unmet peer dependency "react@^17.0.2".
warning "@strapi/plugin-users-permissions > @strapi/helper-plugin@4.9.0" has unmet peer dependency "react-dom@^17.0.2".
warning "@strapi/plugin-users-permissions > @strapi/helper-plugin@4.9.0" has unmet peer dependency "react-router-dom@5.3.4".
warning "@strapi/plugin-users-permissions > @strapi/helper-plugin@4.9.0" has unmet peer dependency "styled-components@5.3.3".
warning "@strapi/plugin-users-permissions > @strapi/icons@1.6.6" has unmet peer dependency "react@^17.0.2".
warning "@strapi/plugin-users-permissions > @strapi/icons@1.6.6" has unmet peer dependency "react-dom@^17.0.2".
warning "@strapi/plugin-users-permissions > formik@2.2.9" has unmet peer dependency "react@>=16.8.0".
warning "@strapi/plugin-users-permissions > react-intl@6.3.2" has unmet peer dependency "react@^16.6.0 || 17 || 18".
warning "@strapi/plugin-users-permissions > react-query@3.24.3" has unmet peer dependency "react@^16.8.0 || ^17.0.0".
warning "@strapi/plugin-users-permissions > react-redux@8.0.5" has unmet peer dependency "react@^16.8 || ^17.0 || ^18.0".
warning "@strapi/strapi > @strapi/admin > @strapi/design-system > @uiw/react-codemirror@4.19.11" has unmet peer dependency "@codemirror/state@>=6.0.0".
warning "@strapi/strapi > @strapi/admin > @strapi/design-system > @uiw/react-codemirror@4.19.11" has unmet peer dependency "@codemirror/theme-one-dark@>=6.0.0".
warning "@strapi/strapi > @strapi/admin > @strapi/design-system > @uiw/react-codemirror@4.19.11" has unmet peer dependency "@codemirror/view@>=6.0.0".
warning "@strapi/strapi > @strapi/admin > @strapi/design-system > @uiw/react-codemirror@4.19.11" has unmet peer dependency "codemirror@>=6.0.0".
warning "@strapi/strapi > @strapi/admin > @strapi/design-system > @uiw/react-codemirror > @uiw/codemirror-extensions-basic-setup@4.19.11" has unmet peer dependency "@codemirror/autocomplete@>=6.0.0".
warning "@strapi/strapi > @strapi/admin > @strapi/design-system > @uiw/react-codemirror > @uiw/codemirror-extensions-basic-setup@4.19.11" has unmet peer dependency "@codemirror/language@>=6.0.0".
warning "@strapi/strapi > @strapi/admin > @strapi/design-system > @uiw/react-codemirror > @uiw/codemirror-extensions-basic-setup@4.19.11" has unmet peer dependency "@codemirror/lint@>=6.0.0".
warning "@strapi/strapi > @strapi/admin > @strapi/design-system > @uiw/react-codemirror > @uiw/codemirror-extensions-basic-setup@4.19.11" has unmet peer dependency "@codemirror/search@>=6.0.0".warning "@strapi/strapi > @strapi/admin > @strapi/design-system > @uiw/react-codemirror > @uiw/codemirror-extensions-basic-setup@4.19.11" has unmet peer dependency "@codemirror/view@>=6.0.0".
warning "@strapi/strapi > @strapi/admin > @strapi/design-system > @uiw/react-codemirror > codemirror > @codemirror/autocomplete@6.4.2" has unmet peer dependency "@lezer/common@^1.0.0".
warning " > @strapi/plugin-users-permissions@4.9.0" has unmet peer dependency "react@^17.0.2".
warning " > @strapi/plugin-users-permissions@4.9.0" has unmet peer dependency "react-dom@^17.0.2".
warning " > @strapi/plugin-users-permissions@4.9.0" has unmet peer dependency "react-router-dom@5.3.4".
warning " > @strapi/plugin-users-permissions@4.9.0" has unmet peer dependency "styled-components@5.3.3".
warning " > @strapi/plugin-i18n@4.9.0" has unmet peer dependency "react@^17.0.2".
warning " > @strapi/plugin-i18n@4.9.0" has unmet peer dependency "react-dom@^17.0.2".
warning " > @strapi/plugin-i18n@4.9.0" has unmet peer dependency "react-router-dom@5.3.4".
warning " > @strapi/plugin-i18n@4.9.0" has unmet peer dependency "styled-components@5.3.3".
[5/5] Building fresh packages...
[-/5] ⠄ waiting...
[-/5] ⡀ waiting...
[3/5] ⡀ sharp
[-/5] ⡀ waiting...
error C:\Users\xxx-api\node_modules\sharp: Command failed.
Exit code: 1
Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
Arguments:
Directory: C:\Users\xxx-api\node_modules\sharp
Output:
PS C:\Users\xxx-api> node install/libvips && node install/dll-copy && prebuild-install
At line:1 char:22
+ node install/libvips && node install/dll-copy && prebuild-install
+ ~~
The token '&&' is not a valid statement separator in this version.
At line:1 char:47
+ node install/libvips && node install/dll-copy && prebuild-install
+ ~~
The token '&&' is not a valid statement separator in this version.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : InvalidEndOfLine
PS C:\Users\xxx-api> npm config set sharp_binary_host "https://npm.taobao.org/mirrors/sharp"
PS C:\Users\xxx-api> npm config set sharp_libvips_binary_host "https://npm.taobao.org/mirrors/sharp-libvips"
PS C:\Users\xxx-api> npm install sharp
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: styled-components@5.3.3
npm WARN Found: react-is@17.0.2
npm WARN node_modules/styled-components/node_modules/react-is
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react-is@">= 16.8.0" from styled-components@5.3.3
npm WARN node_modules/styled-components
npm WARN peer styled-components@">= 2" from babel-plugin-styled-components@2.1.1
npm WARN node_modules/styled-components/node_modules/babel-plugin-styled-components
npm WARN 8 more (babel-plugin-styled-components, ...)
npm ERR! code 1
npm ERR! path C:\Users\xxx-api\node_modules\sharp
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
npm ERR! sharp: Downloading https://npm.taobao.org/mirrors/sharp-libvips/v8.14.2/libvips-8.14.2-win32-x64.tar.br
npm ERR! sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies
npm ERR! sharp: Installation error: self signed certificate in certificate chain
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Jindi J Sun\AppData\Local\npm-cache\_logs\2023-04-07T07_39_48_839Z-debug-0.log
PS C:\Users\xxx-api> yarn config set sharp_binary_host "https://npm.taobao.org/mirrors/sharp"
yarn config v1.22.19
success Set "sharp_binary_host" to "https://npm.taobao.org/mirrors/sharp".
Done in 0.06s.
PS C:\Users\xxx-api> yarn config set sharp_libvips_binary_host "https://npm.taobao.org/mirrors/sharp-libvips"
yarn config v1.22.19
success Set "sharp_libvips_binary_host" to "https://npm.taobao.org/mirrors/sharp-libvips".
Done in 0.06s.
PS C:\Users\xxx-api> yarn add sharp
yarn add v1.22.19
info No lockfile found.
[1/5] Validating package.json...
[2/5] Resolving packages...
warning @strapi/strapi > koa-body > formidable@1.2.6: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau
warning @strapi/strapi > @strapi/plugin-email > @strapi/provider-email-sendmail > sendmail > mailcomposer@3.12.0: This project is unmaintained
warning @strapi/strapi > @strapi/plugin-email > @strapi/provider-email-sendmail > sendmail > mailcomposer > buildmail@3.10.0: This project is unmaintained
warning @strapi/strapi > @strapi/generators > plop > liftoff > findup-sync > micromatch > snapdragon > source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
warning @strapi/strapi > @strapi/generators > plop > liftoff > findup-sync > micromatch > snapdragon > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
warning @strapi/strapi > @strapi/generators > plop > liftoff > findup-sync > micromatch > snapdragon > source-map-resolve > source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
warning @strapi/strapi > @strapi/generators > plop > liftoff > findup-sync > micromatch > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
[3/5] Fetching packages...
[4/5] Linking dependencies...
warning "@strapi/strapi > @strapi/plugin-content-type-builder@4.9.0" has unmet peer dependency "react@^17.0.2".
warning "@strapi/strapi > @strapi/plugin-content-type-builder@4.9.0" has unmet peer dependency "react-dom@^17.0.2".
warning "@strapi/strapi > @strapi/plugin-content-type-builder@4.9.0" has unmet peer dependency "react-router-dom@5.3.4".
warning "@strapi/strapi > @strapi/plugin-content-type-builder@4.9.0" has unmet peer dependency "styled-components@5.3.3".
warning "@strapi/strapi > @strapi/plugin-email@4.9.0" has unmet peer dependency "react@^17.0.2".
warning "@strapi/strapi > @strapi/plugin-email@4.9.0" has unmet peer dependency "react-dom@^17.0.2".
warning "@strapi/strapi > @strapi/plugin-email@4.9.0" has unmet peer dependency "react-router-dom@5.3.4".
warning "@strapi/strapi > @strapi/plugin-email@4.9.0" has unmet peer dependency "styled-components@5.3.3".
warning "@strapi/strapi > @strapi/plugin-upload@4.9.0" has unmet peer dependency "react@^17.0.2".
warning "@strapi/strapi > @strapi/plugin-upload@4.9.0" has unmet peer dependency "react-dom@^17.0.2".
warning "@strapi/strapi > @strapi/plugin-upload@4.9.0" has unmet peer dependency "react-router-dom@5.3.4".
warning "@strapi/strapi > @strapi/plugin-upload@4.9.0" has unmet peer dependency "styled-components@5.3.3".
warning "@strapi/plugin-users-permissions > @strapi/design-system@1.6.6" has unmet peer dependency "react@^17.0.1".
warning "@strapi/plugin-users-permissions > @strapi/design-system@1.6.6" has unmet peer dependency "react-dom@^17.0.1".
warning "@strapi/plugin-users-permissions > @strapi/design-system@1.6.6" has unmet peer dependency "react-router-dom@^5.2.0".
warning "@strapi/plugin-users-permissions > @strapi/design-system@1.6.6" has unmet peer dependency "styled-components@^5.2.1".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > react-helmet@6.1.0" has unmet peer dependency "react@>=16.3.0".
warning "@strapi/plugin-users-permissions > @strapi/icons@1.6.6" has unmet peer dependency "react@^17.0.2".
warning "@strapi/plugin-users-permissions > @strapi/icons@1.6.6" has unmet peer dependency "react-dom@^17.0.2".
warning "@strapi/plugin-users-permissions > @strapi/helper-plugin@4.9.0" has unmet peer dependency "react@^17.0.2".
warning "@strapi/plugin-users-permissions > @strapi/helper-plugin@4.9.0" has unmet peer dependency "react-dom@^17.0.2".
warning "@strapi/plugin-users-permissions > @strapi/helper-plugin@4.9.0" has unmet peer dependency "react-router-dom@5.3.4".
warning "@strapi/plugin-users-permissions > @strapi/helper-plugin@4.9.0" has unmet peer dependency "styled-components@5.3.3".
warning "@strapi/plugin-users-permissions > react-redux@8.0.5" has unmet peer dependency "react@^16.8 || ^17.0 || ^18.0".
warning "@strapi/plugin-users-permissions > react-intl@6.3.2" has unmet peer dependency "react@^16.6.0 || 17 || 18".
warning "@strapi/plugin-users-permissions > formik@2.2.9" has unmet peer dependency "react@>=16.8.0".
warning "@strapi/plugin-users-permissions > react-query@3.24.3" has unmet peer dependency "react@^16.8.0 || ^17.0.0".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > @strapi/design-system > @floating-ui/react-dom@1.3.0" has unmet peer dependency "react@>=16.8.0".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > @strapi/design-system > @floating-ui/react-dom@1.3.0" has unmet peer dependency "react-dom@>=16.8.0".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > @strapi/design-system > @uiw/react-codemirror@4.19.11" has unmet peer dependency "@babel/runtime@>=7.11.0".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > @strapi/design-system > @uiw/react-codemirror@4.19.11" has unmet peer dependency "@codemirror/state@>=6.0.0".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > @strapi/design-system > @uiw/react-codemirror@4.19.11" has unmet peer dependency "@codemirror/theme-one-dark@>=6.0.0".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > @strapi/design-system > @uiw/react-codemirror@4.19.11" has unmet peer dependency "@codemirror/view@>=6.0.0".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > @strapi/design-system > @uiw/react-codemirror@4.19.11" has unmet peer dependency "codemirror@>=6.0.0".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > @strapi/design-system > @uiw/react-codemirror@4.19.11" has unmet peer dependency "react@>=16.8.0".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > @strapi/design-system > @uiw/react-codemirror@4.19.11" has unmet peer dependency "react-dom@>=16.8.0".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > @strapi/design-system > @radix-ui/react-use-callback-ref@1.0.0" has unmet peer dependency "react@^16.8 || ^17.0 || ^18.0".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > react-helmet > react-side-effect@2.1.2" has unmet peer dependency "react@^16.3.0 || ^17.0.0 || ^18.0.0".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > react-redux > use-sync-external-store@1.2.0" has unmet peer dependency "react@^16.8.0 || ^17.0.0 || ^18.0.0".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > @strapi/design-system > @uiw/react-codemirror > @uiw/codemirror-extensions-basic-setup@4.19.11" has unmet peer dependency "@codemirror/autocomplete@>=6.0.0".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > @strapi/design-system > @uiw/react-codemirror > @uiw/codemirror-extensions-basic-setup@4.19.11" has unmet peer dependency "@codemirror/language@>=6.0.0".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > @strapi/design-system > @uiw/react-codemirror > @uiw/codemirror-extensions-basic-setup@4.19.11" has unmet peer dependency "@codemirror/lint@>=6.0.0".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > @strapi/design-system > @uiw/react-codemirror > @uiw/codemirror-extensions-basic-setup@4.19.11" has unmet peer dependency "@codemirror/search@>=6.0.0".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > @strapi/design-system > @uiw/react-codemirror > @uiw/codemirror-extensions-basic-setup@4.19.11" has unmet peer dependency "@codemirror/view@>=6.0.0".
warning "@strapi/strapi > @strapi/plugin-content-type-builder > @strapi/design-system > @uiw/react-codemirror > codemirror > @codemirror/autocomplete@6.4.2" has unmet peer dependency "@lezer/common@^1.0.0".
warning " > @strapi/plugin-users-permissions@4.9.0" has unmet peer dependency "react@^17.0.2".
warning " > @strapi/plugin-users-permissions@4.9.0" has unmet peer dependency "react-dom@^17.0.2".
warning " > @strapi/plugin-users-permissions@4.9.0" has unmet peer dependency "react-router-dom@5.3.4".
warning " > @strapi/plugin-users-permissions@4.9.0" has unmet peer dependency "styled-components@5.3.3".
warning " > @strapi/plugin-i18n@4.9.0" has unmet peer dependency "react@^17.0.2".
warning " > @strapi/plugin-i18n@4.9.0" has unmet peer dependency "react-dom@^17.0.2".
warning " > @strapi/plugin-i18n@4.9.0" has unmet peer dependency "react-router-dom@5.3.4".
warning " > @strapi/plugin-i18n@4.9.0" has unmet peer dependency "styled-components@5.3.3".
[5/5] Building fresh packages...
[-/6] ⡀ waiting...
[6/6] ⡀ sharp
[3/6] ⡀ sharp
[-/6] ⢀ waiting...
error C:\Users\xxx-api\node_modules\@strapi\plugin-upload\node_modules\sharp: Command failed.
Exit code: 1
Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
Arguments:
Directory: C:\Users\xxx-api\node_modules\@strapi\plugin-upload\node_modules\sharp
Output:
PS C:\Users\xxx-api>>
解决方案:
-
- 使用靠靠谱的网络
-
- 在项目目录下配置.yarnrc(或者.npmrc文件)
registry "https://registry.npm.taobao.org"
sass_binary_site "https://npm.taobao.org/mirrors/node-sass/"
phantomjs_cdnurl "http://cnpmjs.org/downloads"
electron_mirror "https://npm.taobao.org/mirrors/electron/"
sqlite3_binary_host_mirror "https://foxgis.oss-cn-shanghai.aliyuncs.com/"
profiler_binary_host_mirror "https://npm.taobao.org/mirrors/node-inspector/"
chromedriver_cdnurl "https://cdn.npm.taobao.org/dist/chromedriver"
sharp_binary_host "https://npm.taobao.org/mirrors/sharp"
sharp_libvips_binary_host "https://npm.taobao.org/mirrors/sharp-libvips"
执行命令,成功安装
yarn install
今天就写到这里啦~
- 小伙伴们,( ̄ω ̄( ̄ω ̄〃 ( ̄ω ̄〃)ゝ我们明天再见啦~~
- 大家要天天开心哦
欢迎大家指出文章需要改正之处~
学无止境,合作共赢