在React中安装particle.js时出现NPM错误

qojgxg4l  于 2023-03-08  发布在  React
关注(0)|答案(3)|浏览(290)

我在React应用程序中安装 particle.js 时遇到以下错误:

code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: app-test@0.1.0
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR!   react@"^17.0.1" from the root project   
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.0.0" from react-particles-js@3.4.1  
npm ERR! node_modules/react-particles-js
npm ERR!   react-particles-js@"*" 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\gydee\AppData\Local\npm-cache\eresolve-report.txt for a full report.
sd2nnvve

sd2nnvve1#

这是来自NPM版本7的问题,使用:

npm install --legacy-peer-deps

帮我修好了

zvms9eto

zvms9eto2#

npm install react-particles-js --force
yks3o0rb

yks3o0rb3#

npm安装React粒子-js -强制或-遗留对等部署

相关问题