npm安装webpack时,报错npm WARN ajv-keywords@3.1.0 requires a peer of ajv@^6.0.0 but none is installed

报错

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 webpack-cli@2.1.3 requires a peer of webpack@^4.0.0 but none is installed. You must install peer dependencies yourself.

解决方式:

您可以使用npm-install-peers查找并安装所需的对等体依赖关系。

先使用npm install -g npm-install-peers后再安装npm install webpack 就不会报错

如果在更新任何软件包版本后出现此错误,请删除node_modules目录并使用npm installnpm cache clean和重新安装软件包npm install

HTTPROOT | 自学PHP | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 石头哥 |微信小程序 |木讯
Copyright © 1998 - 2016 HTTPROOT.COM. All Rights Reserved httproot.com 版权所有