【发布时间】:2022-02-09 12:38:27
【问题描述】:
这是我第一次从github克隆react项目
我做到了:
$ git clone <link>
之后:
npm install
但我遇到了 google-maps-react 的错误
$ npm install --save google-maps-react
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: @iso/here@4.0.0
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR! react@"^17.0.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"~0.14.8 || ^15.0.0 || ^16.0.0" from google-maps-react@2.0.6
npm ERR! node_modules/google-maps-react
npm ERR! google-maps-react@"^2.0.6" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\user\AppData\Local\npm-cache\eresolve-report.txt for a full report.
我试过了:
$ npm cache clean --force
$ npm install -g npm
,:
$npm config set legacy-peer-deps true
,:
npm install --force
,:
npm install --save --legacy-peer-deps
,:
rm -rf node_modules
还有更多..
节点js版本:
16.13.2
反应版本:
17.0.2
npm 版本:
8.4.1
似乎没有任何效果
我错过了什么吗?
【问题讨论】:
-
你试过删除 next 和 node_modules 文件夹并运行 yarn 吗?
标签: node.js reactjs npm installation next.js