我尝试使用
安装它npm i --save react-Paypal-express-checkout
但是我得到了一个错误提示
npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: client@0.1.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.5.0" from react-paypal-express-checkout@1.0.5 npm ERR! node_modules/react-paypal-express-checkout npm ERR! react-paypal-express-checkout@"*" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command.
如果有人帮我,那就太好了。怎么修?试试这个命令-
npm install --save --legacy-peer-deps react-paypal-express-checkout
——legacy-peer-deps导致npm在构建包树时完全忽略peerDependencies,就像npm版本3到6一样。如果一个包因为过于严格的peerDependencies冲突而无法安装,它提供了一种继续解决这种情况的方法。
看到更多…
PS:还记得当你在NPM命令中使用包/库名时,只使用简单的字母