npm需要以下对象的同伴

标签 npm vuejs2 dependencies

当我尝试npm安装任何新软件包时,我的vue项目停止工作。我正在安装axios。

首先我得到了

npm install
npm WARN ajv-keywords@3.2.0 requires a peer of ajv@^6.0.0 but none is
  installed. You must install peer dependencies yourself.
npm WARN url-loader@1.1.1 requires a peer of webpack@^4.0.0 but none is
  installed. You must install peer dependencies yourself.
npm WARN webpack-dev-middleware@3.4.0 requires a peer of webpack@^4.0.0
  but none is installed. You must install peer dependencies yourself.
npm WARN webpack-dev-server@3.1.10 requires a peer of webpack@^4.0.0 but
  none is installed. You must install peer dependencies yourself.


所以我安装了那些软件包,

npm install ajv-keywords@3.2.0  ajv@^6.0.0 url-loader@1.1.1  webpack@^4.0.0 webpack-dev-middleware@3.4.0  webpack@^4.0.0 webpack-dev-server@3.1.10  webpack@^4.0.0 

然后我得到这些警告,

npm WARN extract-text-webpack-plugin@3.0.2 requires a peer of webpack@^3.1.0
  but none is installed. You must install peer dependencies yourself.
npm WARN html-webpack-plugin@2.30.1 requires a peer of
  webpack@1 || ^2 || ^2.1.0-beta || ^2.2.0-rc || ^3 but
  none is installed. You must install peer dependencies yourself.


告诉我使用webpack 3

所以我跑了

npm install webpack@^3.1.0 extract-text-webpack-plugin@3.0.2 html-webpack-plugin@2.30.1

然后,它给我以下警告,告诉您使用webpack4。

npm WARN url-loader@1.1.1 requires a peer of webpack@^4.0.0 but none
  is installed. You must install peer dependencies yourself.
npm WARN webpack-dev-middleware@3.4.0 requires a peer of webpack@^4.0.0
  but none is installed. You must install peer dependencies yourself.
npm WARN webpack-dev-server@3.1.10 requires a peer of webpack@^4.0.0 but none
  is installed. You must install peer dependencies yourself.


我怎么解决这个问题?

谢谢,

最佳答案

您是否尝试安装webpack@^4.0.0?

npm install webpack@^4.0.0

关于npm需要以下对象的同伴,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53321300/

相关文章:

node.js - npm 3.5.4 : EBUNDLEOVERRIDE during update causes npmlog error

javascript - 基本 Vue 帮助 : Accessing JS object values in component

.net - 类似于 VS 2010 Ultimate 的依赖关系图?

r - 在不安装包的情况下列出 R 包依赖项

npm - 使用 Gulp-SASS 从 node_modules 导入 CSS

javascript - Node.js 的 Cluster 模块和 Learnboost 的 Cluster 模块有什么区别?

node.js - Raspberry 和 nodered-nodejs-npm 语法错误

javascript - 子组件是否应该有权访问商店?

javascript - Vuex 竞争条件

java - 在 Maven 依赖项中插入许可证