我似乎无法在我的新Macbook Pro上运行此项目:
https://github.com/apollographql/gatsby-theme-apollo/tree/main/packages/gatsby-theme-apollo-docs
这是要运行的命令:
npm安装盖茨比主题阿波罗文档
我收到所有这些“无法解决依赖关系”警告,我尝试运行:
npm审计修复
和
npm审计修复——强制
但仍然无法让这个项目运行。当我运行它时,它是这么说的:
@MBP16inch2021 test % sudo npm install gatsby-theme-apollo-docs
Password:
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: gatsby-theme-apollo-docs@5.3.1
npm WARN Found: react@16.14.0
npm WARN node_modules/gatsby-theme-apollo-docs/node_modules/react
npm WARN peer react@"^0.14.0 || ^15.0.0 || ^16.0.0" from recompose@0.30.0
npm WARN node_modules/gatsby-theme-apollo-docs/node_modules/recompose
npm WARN recompose@"^0.30.0" from gatsby-theme-apollo-docs@5.3.1
npm WARN node_modules/gatsby-theme-apollo-docs
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@">=16.9.0" from gatsby-theme-apollo-docs@5.3.1
npm WARN node_modules/gatsby-theme-apollo-docs
npm WARN gatsby-theme-apollo-docs@"^5.3.1" from the root project
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: react-use@9.12.0
npm WARN Found: react@17.0.2
npm WARN node_modules/react
npm WARN react@"^17.0.2" from the root project
npm WARN 18 more (@apollo/space-kit, @emotion/core, @emotion/styled, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"^16.8.0" from react-use@9.12.0
npm WARN node_modules/gatsby-theme-apollo-core/node_modules/react-use
npm WARN react-use@"^9.11.0" from gatsby-theme-apollo-core@3.0.35
npm WARN node_modules/gatsby-theme-apollo-core
npm WARN
npm WARN Conflicting peer dependency: react@16.14.0
npm WARN node_modules/react
npm WARN peer react@"^16.8.0" from react-use@9.12.0
npm WARN node_modules/gatsby-theme-apollo-core/node_modules/react-use
npm WARN react-use@"^9.11.0" from gatsby-theme-apollo-core@3.0.35
npm WARN node_modules/gatsby-theme-apollo-core
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: react-use@9.12.0
npm WARN Found: react-dom@17.0.2
npm WARN node_modules/react-dom
npm WARN peer react-dom@">=16.8" from @tippyjs/react@4.2.5
npm WARN node_modules/@tippyjs/react
npm WARN @tippyjs/react@"^4.0.0" from @apollo/space-kit@5.6.3
npm WARN node_modules/@apollo/space-kit
npm WARN 11 more (apollo-algolia-autocomplete, framer-motion, gatsby, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react-dom@"^16.8.0" from react-use@9.12.0
npm WARN node_modules/gatsby-theme-apollo-core/node_modules/react-use
npm WARN react-use@"^9.11.0" from gatsby-theme-apollo-core@3.0.35
npm WARN node_modules/gatsby-theme-apollo-core
npm WARN
npm WARN Conflicting peer dependency: react-dom@16.14.0
npm WARN node_modules/react-dom
npm WARN peer react-dom@"^16.8.0" from react-use@9.12.0
npm WARN node_modules/gatsby-theme-apollo-core/node_modules/react-use
npm WARN react-use@"^9.11.0" from gatsby-theme-apollo-core@3.0.35
npm WARN node_modules/gatsby-theme-apollo-core
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @reach/router@1.3.4
npm WARN Found: react@17.0.2
npm WARN node_modules/react
npm WARN react@"^17.0.2" from the root project
npm WARN 18 more (@apollo/space-kit, @emotion/core, @emotion/styled, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"15.x || 16.x || 16.4.0-alpha.0911da3" from @reach/router@1.3.4
npm WARN node_modules/gatsby/node_modules/@reach/router
npm WARN @reach/router@"^1.3.4" from gatsby@2.32.13
npm WARN node_modules/gatsby
npm WARN 2 more (gatsby-link, gatsby-react-router-scroll)
npm WARN
npm WARN Conflicting peer dependency: react@16.14.0
npm WARN node_modules/react
npm WARN peer react@"15.x || 16.x || 16.4.0-alpha.0911da3" from @reach/router@1.3.4
npm WARN node_modules/gatsby/node_modules/@reach/router
npm WARN @reach/router@"^1.3.4" from gatsby@2.32.13
npm WARN node_modules/gatsby
npm WARN 2 more (gatsby-link, gatsby-react-router-scroll)
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @reach/router@1.3.4
npm WARN Found: react-dom@17.0.2
npm WARN node_modules/react-dom
npm WARN peer react-dom@">=16.8" from @tippyjs/react@4.2.5
npm WARN node_modules/@tippyjs/react
npm WARN @tippyjs/react@"^4.0.0" from @apollo/space-kit@5.6.3
npm WARN node_modules/@apollo/space-kit
npm WARN 11 more (apollo-algolia-autocomplete, framer-motion, gatsby, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react-dom@"15.x || 16.x || 16.4.0-alpha.0911da3" from @reach/router@1.3.4
npm WARN node_modules/gatsby/node_modules/@reach/router
npm WARN @reach/router@"^1.3.4" from gatsby@2.32.13
npm WARN node_modules/gatsby
npm WARN 2 more (gatsby-link, gatsby-react-router-scroll)
npm WARN
npm WARN Conflicting peer dependency: react-dom@16.14.0
npm WARN node_modules/react-dom
npm WARN peer react-dom@"15.x || 16.x || 16.4.0-alpha.0911da3" from @reach/router@1.3.4
npm WARN node_modules/gatsby/node_modules/@reach/router
npm WARN @reach/router@"^1.3.4" from gatsby@2.32.13
npm WARN node_modules/gatsby
npm WARN 2 more (gatsby-link, gatsby-react-router-scroll)
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: react-side-effect@1.2.0
npm WARN Found: react@17.0.2
npm WARN node_modules/react
npm WARN react@"^17.0.2" from the root project
npm WARN 18 more (@apollo/space-kit, @emotion/core, @emotion/styled, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"^0.13.0 || ^0.14.0 || ^15.0.0 || ^16.0.0" from react-side-effect@1.2.0
npm WARN node_modules/react-helmet/node_modules/react-side-effect
npm WARN react-side-effect@"^1.1.0" from react-helmet@5.2.1
npm WARN node_modules/react-helmet
npm WARN
npm WARN Conflicting peer dependency: react@16.14.0
npm WARN node_modules/react
npm WARN peer react@"^0.13.0 || ^0.14.0 || ^15.0.0 || ^16.0.0" from react-side-effect@1.2.0
npm WARN node_modules/react-helmet/node_modules/react-side-effect
npm WARN react-side-effect@"^1.1.0" from react-helmet@5.2.1
npm WARN node_modules/react-helmet
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: create-react-context@0.3.0
npm WARN Found: react@17.0.2
npm WARN node_modules/react
npm WARN react@"^17.0.2" from the root project
npm WARN 18 more (@apollo/space-kit, @emotion/core, @emotion/styled, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"^0.14.0 || ^15.0.0 || ^16.0.0" from create-react-context@0.3.0
npm WARN node_modules/gatsby/node_modules/@reach/router/node_modules/create-react-context
npm WARN create-react-context@"0.3.0" from @reach/router@1.3.4
npm WARN node_modules/gatsby/node_modules/@reach/router
npm WARN
npm WARN Conflicting peer dependency: react@16.14.0
npm WARN node_modules/react
npm WARN peer react@"^0.14.0 || ^15.0.0 || ^16.0.0" from create-react-context@0.3.0
npm WARN node_modules/gatsby/node_modules/@reach/router/node_modules/create-react-context
npm WARN create-react-context@"0.3.0" from @reach/router@1.3.4
npm WARN node_modules/gatsby/node_modules/@reach/router
up to date, audited 2746 packages in 6s
298 packages are looking for funding
run `npm fund` for details
70 vulnerabilities (4 low, 30 moderate, 36 high)
To address issues that do not require attention, run:
npm audit fix
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
我已经重新启动、安装了最新版本的node、react等。似乎无法让这件事运行,我不知道我在用这个npm审计修复程序做什么,但没有解决它。谢谢你的帮助!
根据这篇帖子上的评论编辑我尝试了几个新命令:
当我跑的时候
npm i react@16.14.0
我得到:
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: gatsby-theme-apollo-docs@5.3.1
npm WARN Found: react@16.14.0
npm WARN node_modules/react
npm WARN peer react@"^16.13.1 || ^17.0.0" from @mdx-js/react@1.6.22
npm WARN node_modules/@mdx-js/react
npm WARN peer @mdx-js/react@"^1.0.0" from gatsby-plugin-mdx@1.10.1
npm WARN node_modules/gatsby-plugin-mdx
npm WARN 1 more (the root project)
npm WARN 21 more (gatsby, @reach/router, create-react-context, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"17.0.2" from apollo-algolia-autocomplete@1.2.1
npm WARN node_modules/apollo-algolia-autocomplete
npm WARN apollo-algolia-autocomplete@"^1.2.1" from the root project
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: gatsby-theme-apollo-docs@5.3.1
npm WARN Found: react@16.14.0
npm WARN node_modules/react
npm WARN peer react@"^16.13.1 || ^17.0.0" from @mdx-js/react@1.6.22
npm WARN node_modules/@mdx-js/react
npm WARN peer @mdx-js/react@"^1.0.0" from gatsby-plugin-mdx@1.10.1
npm WARN node_modules/gatsby-plugin-mdx
npm WARN 1 more (the root project)
npm WARN 21 more (gatsby, @reach/router, create-react-context, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"^0.14.0 || ^15.0.0" from recompose@0.17.0
npm WARN node_modules/recompose
npm WARN recompose@"^0.17.0" from the root project
up to date, audited 2952 packages in 3s
324 packages are looking for funding
run `npm fund` for details
62 vulnerabilities (30 moderate, 32 high)
To address issues that do not require attention, run:
npm audit fix
Some issues need review, and may require choosing
a different dependency.
Run `npm audit` for details.
当我跑的时候
npm i react-dom@16.14.0
我得到:
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: gatsby-theme-apollo-docs@5.3.1
npm WARN Found: react-dom@16.14.0
npm WARN node_modules/react-dom
npm WARN peer react-dom@"^16.4.2 || ^17.0.0" from gatsby@2.32.13
npm WARN node_modules/gatsby
npm WARN peer gatsby@"^2.0.0" from babel-plugin-remove-graphql-queries@2.16.1
npm WARN node_modules/babel-plugin-remove-graphql-queries
npm WARN 17 more (gatsby-plugin-algolia, ...)
npm WARN 11 more (@reach/router, gatsby-link, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react-dom@"17.0.2" from apollo-algolia-autocomplete@1.2.1
npm WARN node_modules/apollo-algolia-autocomplete
npm WARN apollo-algolia-autocomplete@"^1.2.1" from the root project
up to date, audited 2952 packages in 21s
324 packages are looking for funding
run `npm fund` for details
62 vulnerabilities (30 moderate, 32 high)
To address issues that do not require attention, run:
npm audit fix
Some issues need review, and may require choosing
a different dependency.
Run `npm audit` for details.