webpack-cli: Cannot run webpack-cli after install

After trying to run “webpack-cli” for config migrating, I got this error output. macOS Sierra 10.12.6 npm v5.4.2 node v8.7.0 (installed via nvm) webpack-cli v1.3.9

npm i -g webpack-cli
webpack-cli migrate webpack.config.js

module.js:529
    throw err;
    ^

Error: Cannot find module './utils/webpackOptionsSchema.json'
    at Function.Module._resolveFilename (module.js:527:15)
    at Function.Module._load (module.js:476:23)
    at Module.require (module.js:568:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/dphov/.nvm/versions/node/v8.7.0/lib/node_modules/webpack-cli/dist/migrate.js:10:30)
    at Module._compile (module.js:624:30)
    at Object.Module._extensions..js (module.js:635:10)
    at Module.load (module.js:545:32)
    at tryModuleLoad (module.js:508:12)
    at Function.Module._load (module.js:500:3)

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 14
  • Comments: 34 (13 by maintainers)

Most upvoted comments

Do npm install -g webpack-cli, it should have 1.4.0 now, reverted some things, as @ematipico did a PR for flow that made the build broken, tried to fix it by adding compilation and stuff, so that we could support v4 of node, will do some more investigating to make sure it works 100%. Sorry for the bug you guys had, having a hard time finding time for open source atm, as I’m working + full time student 😦

As mentioned earlier, would be super-awesome if someone made a PR that fixes distribution and flow-compilation

WhatsApp Image 2019-12-12 at 12 41 27 PM (2) WhatsApp Image 2019-12-12 at 12 41 27 PM (1) WhatsApp Image 2019-12-12 at 12 41 27 PM @evenstensberg please help me out of this

@ev1stensberg The two solutions you presented webpack-cli migrate ./webpack.config.js and getting the version v.3.0.1 and above works like a charm

I’m having this error when I try to run foreman:

foreman start
15:49:28 web.1     | started with pid 3626
15:49:28 webpack.1 | started with pid 3627
15:49:30 webpack.1 | internal/modules/cjs/loader.js:573
15:49:30 webpack.1 |     throw err;
15:49:30 webpack.1 |     ^
15:49:30 webpack.1 |
15:49:30 webpack.1 | Error: Cannot find module 'webpack/schemas/WebpackOptions.json'
15:49:30 webpack.1 |     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:571:15)
15:49:30 webpack.1 |     at Function.Module._load (internal/modules/cjs/loader.js:497:25)
15:49:30 webpack.1 |     at Module.require (internal/modules/cjs/loader.js:626:17)
15:49:30 webpack.1 |     at require (internal/modules/cjs/helpers.js:20:18)
15:49:30 webpack.1 |     at Object.<anonymous> (/Users/romenigld/ror_workspace/tutorials/onebitcode/onebitflix/node_modules/webpack-cli/bin/config-yargs.js:1:85)
15:49:30 webpack.1 |     at Module._compile (internal/modules/cjs/loader.js:678:30)
15:49:30 webpack.1 |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
15:49:30 webpack.1 |     at Module.load (internal/modules/cjs/loader.js:589:32)
15:49:30 webpack.1 |     at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
15:49:30 webpack.1 |     at Function.Module._load (internal/modules/cjs/loader.js:520:3)
15:49:30 webpack.1 | exited with code 1
15:49:30 system    | sending SIGTERM to all processes
15:49:30 web.1     | terminated by SIGTERM

Closing this per now, feel free to open a new issue if something comes up, I’m available for questions or elaboration anytime ❤️