webpack.validateSchema is not a function

Christoffer Johansen picture Christoffer Johansen · Nov 14, 2016 · Viewed 28.5k times · Source

Webpack are throwing this error all of a sudden:

TypeError: webpack.validateSchema is not a function

Everything was working fine Friday, not working today. No new commits to master since Friday.

Pruned NPM, that didn't work, deleted NPM folder and re-installed, no dice. Checked out to previous branches which have not been rebased from Master for over a week. Still the same.

Anyone have an idea?

Answer

BartBiczBoży picture BartBiczBoży · Nov 15, 2016

Looks like npm bug, since [email protected] requires webpack@^2.1.0-beta.26 but npm failed to install it.

The easiest way to avoid the issue without updating too much is to change dependency in package.json to

  "webpack-dev-server": "2.1.0-beta.10",

Instead of something like

  "webpack-dev-server": "^2.1.0-beta.9",

"^" char before version says "compatible with". Removing it sticks to the version exactly.

Don't forget to run npm install or npm update afterwards.