npm WARN [email protected] requires a peer of [email protected] but none is installed. You must install

安装webpack和webpack-cli时出现的问题:
npm WARN [email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.

问题翻译::
NPMWA [email protected]需要一个[email protected]的对等点,但没有安装。您必须自己安装对等依赖项。

原因:
安装时命令:npm install webpack -g
npm install webpack-cli -g
默认安装了webpack最新版本,导致安装的最新脚手架webpack-cli与webpack版本不匹配,导致安装错误
解决:

  1. 指定webpack安装版本:
			npm install [email protected] -g
  1. 指定webpack安装的版本如下:
			npm install [email protected] -g
  1. 安装成功:
PS D:\developer\IdeaProjects\itcast-nodejs> npm install [email protected] -g
D:\developer\node.js\npm_modules\webpack -> D:\developer\node.js\npm_modules\node_modules\webpack\bin\webpack.js
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\webpack\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ [email protected]
added 323 packages from 198 contributors in 27.276s
PS D:\developer\IdeaProjects\itcast-nodejs> npm install [email protected] -g
D:\developer\node.js\npm_modules\webpack-cli -> D:\developer\node.js\npm_modules\node_modules\webpack-cli\bin\cli.js

> [email protected] postinstall D:\developer\node.js\npm_modules\node_modules\webpack-cli
> node ./bin/opencollective.js



                            **Thanks for using Webpack!
                 Please consider donating to our Open Collective
                        to help us maintain this package.**



                 Donate: https://opencollective.com/webpack/donate


npm WARN [email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.

+ [email protected]
added 206 packages from 126 contributors in 18.13s
在这里插入代码片

你可能感兴趣的:(错题本)