Node.js 使用Webpack和cypress react
似乎我无法在使用Webpack的项目中使用@cypress/react。 每次尝试安装时,我都会收到以下错误消息:Node.js 使用Webpack和cypress react,node.js,npm,webpack,dependencies,cypress,Node.js,Npm,Webpack,Dependencies,Cypress,似乎我无法在使用Webpack的项目中使用@cypress/react。 每次尝试安装时,我都会收到以下错误消息: while resolving: min-working-example@1.0.0 Found: webpack@5.24.4 node_modules/webpack dev webpack@"*" from the root project peer webpack@">=2" from babel-loader@8.2.
while resolving: min-working-example@1.0.0
Found: webpack@5.24.4
node_modules/webpack
dev webpack@"*" from the root project
peer webpack@">=2" from babel-loader@8.2.2
node_modules/babel-loader
peerOptional babel-loader@"^=8.x" from @cypress/react@4.16.4
node_modules/@cypress/react
dev @cypress/react@"*" from the root project
Could not resolve dependency:
peerOptional webpack@"^=3.x" from @cypress/react@4.16.4
node_modules/@cypress/react
dev @cypress/react@"*" from the root project
Fix the upstream dependency conflict, or retry
this command with --force, or --legacy-peer-deps
to accept an incorrect (and potentially broken) dependency resolution.
我自己无法解决这个问题
为了重现问题,只需
创建amn空目录,执行npm初始化
npm i-保存开发网页包cypress@cypress/react
如错误消息最后几行所述,您可以通过使用传统的peer-deps开关来解决这个问题。这并不理想,但在两个模块之间的对等依赖项对齐之前,您应该能够使其正常工作。您是否尝试过npm Audit这是一个好主意,但我甚至不能首先安装它。我认为我需要在我的源代码中有一些这方面的痕迹,以便开始审计