首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >一个人怎么能处理webpack版本的问题?需要一位.但没有安装吗?

一个人怎么能处理webpack版本的问题?需要一位.但没有安装吗?
EN

Stack Overflow用户
提问于 2020-11-08 04:09:53
回答 1查看 5.1K关注 0票数 3

首先收到错误:optimize-css-assets-webpack-plugin@5.0.4 requires a peer of webpack@^4.0.0,然后尝试使用以下内容:npm i optimize-css-assets-webpack-plugin@latest,但得到了消息:terser-webpack-plugin@5.0.3 requires a peer of webpack@^5.1.0

我正在为我的问题寻求一个具体的答案,但我认为,对于其他人来说,有一种思考如何处理其他NPM包中类似问题的一般方式也是有用的。

  • ,我有一个一般性问题,因为我尝试使用°NEST JS°&°REACT°&°,我的TS工作流在同一个回购中.

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

下面的4@4.44.2试图获得零警告消息,安装3个版本的webpack next@5.0.0-rc.6 lates@5.4.0

代码语言:javascript
复制
npm install webpack@next # + webpack@5.0.0-rc.6

npm WARN babel-loader@8.1.0 requires a peer of webpack@>=2 but none is installed. You must install peer dependencies yourself.
npm WARN css-loader@5.0.1 requires a peer of webpack@^4.27.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN eslint-webpack-plugin@2.2.0 requires a peer of webpack@^4.0.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN file-loader@6.2.0 requires a peer of webpack@^4.0.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN html-webpack-plugin@4.5.0 requires a peer of webpack@^4.0.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN mini-css-extract-plugin@1.3.0 requires a peer of webpack@^4.4.0 || ^5.0.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 but none is installed. You must install peer dependencies yourself.
npm WARN postcss-loader@4.0.4 requires a peer of webpack@^4.0.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN sass-loader@10.0.5 requires a peer of webpack@^4.36.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN style-loader@2.0.0 requires a peer of webpack@^4.0.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
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 url-loader@4.1.1 requires a peer of webpack@^4.0.0 || ^5.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-dev-server@3.11.0 requires a peer of webpack@^4.0.0 || ^5.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 WARN workbox-webpack-plugin@6.0.0-alpha.3 requires a peer of webpack@^4.4.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN terser-webpack-plugin@4.2.3 requires a peer of webpack@^4.0.0 || ^5.0.0 but none is installed. You must install peer dependencies yourself.
代码语言:javascript
复制
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.
代码语言:javascript
复制
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.
EN

回答 1

Stack Overflow用户

发布于 2020-11-08 05:01:05

您似乎有一组不兼容的包。我不确定语法,我的经验是作曲家。如果您查看该列表,您将看到大多数包要么需要v4 ,要么需要 v5:

npm WARN mini-css-extract-plugin@1.3.0 requires a peer of webpack@^4.4.0 || ^5.0.0 ... --您有一个需要独占v4的包,另一个需要独占的v5包

代码语言:javascript
复制
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 ...
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64734727

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档