package.json がある前提で
$ npm install --save-dev webpack webpack-cli
ローカルにインストールしたので npx コマンドで実行できる
$ npx webpack -v