O'Reilly logo
  • Nicholas Hoyle thinks this is interesting:

sudo npm install -g webpack


Cover of Learning React, 1st Edition


This doesn't work if you have installed the latest webpack (2.5.0) globally. So you should install webpack 2.2.1 and not globally (it is not recommended to install globally, see: https://webpack.js.org/guides/installation/)
Instead run this command:
npm install --save-dev webpack@2.2.1

this is mentioned further down in the text.