16

I got stock with with error that I dont understand, I have tried a lot of things like reinstalling all the dependencies but it does not work any idea? Here is the error prompt:

No production canister_ids.json found. Continuing with local
[webpack-cli] TypeError: cli.isMultipleCompiler is not a function
    at Command.<anonymous> (/Users/davidmartinezgil/proyect/node_modules/@webpack-cli/serve/lib/index.js:146:35)
    at async Promise.all (index 1)
    at async Command.<anonymous> (/Users/davidmartinezgil/proyect/node_modules/webpack-cli/lib/webpack-cli.js:1674:7)
Yves M.
  • 29,855
  • 23
  • 108
  • 144

12 Answers12

40

I had a similar error trying to run a Jhipster app, the error is:

[webpack-cli] TypeError: cli.isMultipleCompiler is not a function
at Command.<anonymous> (C:\Users\doe\folder\MyApp\node_modules\@webpack-cli\serve\lib\index.js:146:35)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Promise.all (index 1)
at async Command.<anonymous> (C:\Users\doe\folder\MyApp\node_modules\webpack-cli\lib\webpack-cli.js:1674:7)

Some suggest to update the webpack-cli from 4.9.2 to 4.10.0

For me works and could run npm start

I hope works for you.

References from webpack issues

Yves M.
  • 29,855
  • 23
  • 108
  • 144
Nelson Reyes
  • 586
  • 6
  • 6
  • 2
    Thank you so much It worked I changed the version inside the package.json to 4.10.0 and then runned "npm i" and it worked perfectly when I used the npm start again thank you. – David Martínez Gil Jun 16 '22 at 04:10
  • Is this a [consequence of Node's _semver_](https://developer.okta.com/blog/2019/12/16/semantic-versioning)? I have a project that ran a few weeks ago just fine and now with nothing changed it fails due to this. So I imagine it's either a breaking change in transistive dependencies or maybe some kind of external service no longer available? – ecoe Jul 19 '22 at 13:52
11

Ensure you are in your project directory in your terminal

first, type the following in your terminal and hit enter

npm install --save-dev webpack-cli

then type the following and hit enter:

npm upgrade --save-dev webpack-cli

it should work

Maybe you will have to do this in every new project you create.

6

Here is how you update your webpack-cli for anyone else who was curious.

First, check your version of webpack by running this command in the terminal of your IDE: webpack --version. You should see a list that appears like this:

webpack: 5.71.0
webpack-cli: 4.10.0     
webpack-dev-server 4.8.0

If your webpack-cli reads anything below 4.10.0, then you need to update it to the latest version for npm to run properly on your localhost with JHipster. Here's how to update it.

Run this command in the terminal of your IDE:

npm install webpack-cli@4.10.0

[Right now, the latest version is 4.10.0, but for the future updates when you run this command, change the version at the end of the command line to updated to that current version:

npm install webpack-cli@(INSERT NEW VERSION DIGITS HERE).

Then re-run webpack --version, and see if your webpack has updated to the version that you entered above.


EXTRA NOTES:

Why did you have this error? According to webpack.js.org: "Note that this is not a recommended practice. Installing globally locks you down to a specific version of webpack and could fail in projects that use a different version."

So, if you ran a command like this: npm install --global webpack, then there is a good chance that you were locked down to a specific version. This might have been the error. That's what I believe happened to me anyway. I ran npm install -g, or something of that nature.

Sources for your journey and research that relate to the material above:

  1. https://webpack.js.org/guides/installation/
  2. https://stackabuse.com/npm-install-specific-version-of-a-package/

Hope this helps! Best of blessings to ya!

AndreiC
  • 542
  • 4
  • 16
Taylor
  • 119
  • 1
  • 1
  • 4
0

ensure you are in your project directory in your terminal

Type the following in your terminal and hit enter

npm install webpack-cli

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jul 05 '22 at 10:27
0

If you are using yarn then run yarn add webpack-cli

Olotin Temitope
  • 419
  • 6
  • 13
0

Before saying npm start, try writing the code I marked with an asterisk.

1--dfx deploy ***2--- npm install --save-dev webpack-cli 3- npm start

FurkanGst
  • 1
  • 2
0

for me it was a easy one go to your package.json file and change the version from 4.9.x to 4.10 and run npm install then run npm start again, works like magic!

0

Install webpack-cli version 4.10

npm i webpack-cli@4.10

This might work out.

Jaswanth
  • 1
  • 1
0

I deleted node_modules and package-lock.json. And then run npm install again.

0

Update the "webpack-cli" version in the "package-json" to "4.10.0" , and then run "npm install" in your terminal , then run "npm start" . It worked for me just fine.

Kallux
  • 1
0

Run the below line of code in terminal it will resolve your issue. If your webpack is below version 4.10.0

  1. npm install webpack-cli@4.10.0
0

Update webpack-cli: Make sure you have the latest version of webpack-cli installed. Run the following command to update it:

npm install webpack-cli@latest