webpack-cli migrate webpack.config.js ERROR

Created on 9 Jul 2018  路  12Comments  路  Source: webpack/webpack-cli

I'm updating a webpack.config.js using and this command webpack-cli migrate weebpack.config.js

I'm starting a new project with webpack mini test sample so
I create a directory and run npm init then run npm i webpack --save-dev
I install webpack-cli npm i webpack-cli then i run webpack init automatically install a new webpack.dev.js
I run webpack-cli migrate webpack.config.js this pop the error

C:\Users\Spiralytics04\Desktop\webpack-sample-cli\node_modules\@webpack-cli\migrate\index.js:11
const { validate } = process.webpackModule;`
        ^

TypeError: Cannot destructure property `validate` of 'undefined' or 'null'.
    at Object.<anonymous> (C:\Users\Spiralytics04\Desktop\webpack-sample-cli\node_modules\@webpack-cli\migrate\index.js:11:30)
    at Module._compile (C:\Users\Spiralytics04\Desktop\webpack-sample-cli\node_modules\v8-compile-cache\v8-compile-cache.js:178:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
    at Module.require (module.js:587:17)
    at require (C:\Users\Spiralytics04\Desktop\webpack-sample-cli\node_modules\v8-compile-cache\v8-compile-cache.js:159:20)
    at promptForInstallation (C:\Users\Spiralytics04\Desktop\webpack-sample-cli\node_modules\webpack-cli\bin\prompt-command.js:108:3)
    at C:\Users\Spiralytics04\Desktop\webpack-sample-cli\node_modules\webpack-cli\bin\cli.js:45:37
needs investigation general

Most helpful comment

The same issue and I use:

"webpack-cli": "git+https://github.com/webpack/webpack-cli.git#master"

All 12 comments

Hi! Thanks for filling the issue, please next time don't delete the template! Couple of questions:

  1. You didn't mention the file webpack.config.js in your problem, where does it come from?
  2. Why do you use migrate? Looks like you're creating a new project

same problem

i have tried to switch to version 2.1.1 - but go the
TypeError: Cannot read property 'length' of null
https://github.com/webpack/webpack-cli/issues/542

Which version are you lads at? We need more information 馃憤

this issue error happens on webpack-cli 308

Upgrade to version 3.1.2 and up, an update to the latest version would be the best for you! :)

@ev1stensberg I used following command.

npm i -D webpack-cli@latest

But it is still installing 3.0.8 version

Yep. I'll submit a fix shortly

Fixed on master now. Will publish a new release once @dhruvdutt has fixed the breaking tests in bintestcases.

The same issue and I use:

"webpack-cli": "git+https://github.com/webpack/webpack-cli.git#master"

Any update on this?

It's supposed to be resolved. If you still have this issue, please file a new issue with information of how to reproduce it

Was this page helpful?
0 / 5 - 0 ratings

Related issues

snitin315 picture snitin315  路  5Comments

sumukhah picture sumukhah  路  3Comments

RobotnickIsrael picture RobotnickIsrael  路  5Comments

heyalbert picture heyalbert  路  3Comments

r00nscapenab picture r00nscapenab  路  4Comments