Node.js 如何处理网页版本问题«;需要一位……的同行。。。但是没有安装&xBB;?

Node.js 如何处理网页版本问题«;需要一位……的同行。。。但是没有安装&xBB;?,node.js,npm,webpack,versioning,dependency-management,Node.js,Npm,Webpack,Versioning,Dependency Management,首先我收到这个错误:优化css资产网页包-plugin@5.0.4需要webpack@^4.0.0的对等方然后我尝试使用此:npm I优化css资产webpack-plugin@latest但收到了这样的信息:更简洁的网页包-plugin@5.0.3需要webpack@^5.1.0的对等方 我正在寻找我的问题的具体答案,但我认为,对于其他所有人来说,有一个通用的方法来思考如何处理任何其他NPM包中的类似问题也会很有用 我有这个一般性问题,因为我试图在同一报告中使用“嵌套JS°&“反应°&”我的

首先我收到这个错误:
优化css资产网页包-plugin@5.0.4需要webpack@^4.0.0的对等方
然后我尝试使用此:
npm I优化css资产webpack-plugin@latest
但收到了这样的信息:
更简洁的网页包-plugin@5.0.3需要webpack@^5.1.0的对等方

我正在寻找我的问题的具体答案,但我认为,对于其他所有人来说,有一个通用的方法来思考如何处理任何其他NPM包中的类似问题也会很有用

  • 我有这个一般性问题,因为我试图在同一报告中使用“嵌套JS°&“反应°&”我的TS工作流°

  • 我不知道我是否必须深入每个可能的依赖关系树,或者是否必须打开多个问题,或者是否必须自己(单独)处理这些问题

  • 在安装3个版本的网页时,尝试获取零警告消息next@5.0.0-rc.6
lates@5.4.0
4@4.44.2

npm安装webpack@4 # + webpack@4.44.2 
npm警告已弃用chokidar@2.1.8:Chokidar 2将在节点v14+上中断。升级到chokidar 3,依赖项减少15倍。
npm警告已弃用fsevents@1.2.13:fsevents 1将在节点v14+上中断,并且可能使用不安全的二进制文件。升级至fsevents 2。

npm WARN notsup不支持watchpack的引擎-chokidar2@2.0.0:通缉:{“节点”:“您似乎有一组不兼容的软件包。我不确定语法,我的经验是使用composer。如果您查看该列表,您将看到您的大多数软件包需要v4v5:
npm警告迷你css提取-plugin@1.3.0需要webpack@^4.4.0 | | ^5.0.0…
您有一个包专门需要v4,另一个包专门需要v5

npm WARN optimize-css-assets-webpack-plugin@5.0.4 requires a peer of webpack@^4.0.0 ...

npm WARN terser-webpack-plugin@5.0.3 requires a peer of webpack@^5.1.0 ...

npm@7似乎已经修复了所有的错误messagesnpm@7自动安装PeerDependency,这样您就不会看到此错误,但这并不是解决此错误的方法。只要出现此问题,就可以通过删除
package lock.json
node_modules
并再次运行
npm i
来解决此问题。
npm install webpack@latest # + webpack@5.4.0

npm WARN optimize-css-assets-webpack-plugin@5.0.4 requires a peer of webpack@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN webpack-dev-middleware@3.7.2 requires a peer of webpack@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN webpack-manifest-plugin@2.2.0 requires a peer of webpack@2 || 3 || 4 but none is installed. You must install peer dependencies yourself.

npm install webpack@4 # + webpack@4.44.2 

npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN notsup Unsupported engine for watchpack-chokidar2@2.0.0: wanted: {"node":"<8.10.0"} (current: {"node":"15.1.0","npm":"6.14.8"})
npm WARN notsup Not compatible with your version of node/npm: watchpack-chokidar2@2.0.0
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/watchpack-chokidar2/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN terser-webpack-plugin@5.0.3 requires a peer of webpack@^5.1.0 but none is installed. You must install peer dependencies yourself.


npm WARN optimize-css-assets-webpack-plugin@5.0.4 requires a peer of webpack@^4.0.0 ...

npm WARN terser-webpack-plugin@5.0.3 requires a peer of webpack@^5.1.0 ...