webpack.validateSchema is not a function

后端 未结 10 2065
遇见更好的自我
遇见更好的自我 2020-12-13 12:54

Webpack are throwing this error all of a sudden:

TypeError: webpack.validateSchema is not a function

Everything was working fine

10条回答
  •  借酒劲吻你
    2020-12-13 13:26

    I got this problem because I had an older global version of webpack installed that was somehow conflicting with the project-specific webpack.

    I first un-installed the global (older) webpack by running:

    npm uninstall webpack -g
    

    Then I ran my project-specific webpack. On windows webpack.cmd resides in node_modules.bin\, but if you run webpack via an npm task, npm will search the .bin folder automatically, so no need to specify that path explicitly.

    The functioning npm run task in my package.json looks as follows:

      "scripts": {
          "webpack": "webpack -w --config ./config/dev.js --progress"
      }
    

提交回复
热议问题