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バージョンと一致しないため、インストールエラーが解決されます.
  • webpackインストールバージョンの指定:
  • 			npm install [email protected] -g
    
  • 指定webpackインストールのバージョンは以下の通りです:
  • 			npm install [email protected] -g
    
  • インストール成功:
  • PS D:\developer\IdeaProjects\itcast-nodejs> npm install [email protected] -g
    D:\developer
    ode.js
    pm_modules\webpack -> D:\developer
    ode.js
    pm_modules
    ode_modules\webpack\bin\webpack.js npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\webpack
    ode_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
    ode.js
    pm_modules\webpack-cli -> D:\developer
    ode.js
    pm_modules
    ode_modules\webpack-cli\bin\cli.js > [email protected] postinstall D:\developer
    ode.js
    pm_modules
    ode_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