如何求解[webpack-cli] typeerror:cli.ismultiplecompiler不是函数

发布于 2025-02-07 18:08:53 字数 524 浏览 3 评论 0 原文

我遇到了我不了解的错误,我尝试了很多事情,例如重新安装所有依赖项,但没有任何想法?这是错误提示:

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)

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)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(13

吻安 2025-02-14 18:08:53

我有类似的错误试图运行JHIPSTER应用程序,错误是:

[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)

有些人建议从 4.9.2 4.9.2 更新 webpack-cli 到 4.10.0 < /strong>

对我而言,可以运行 npm Start

我希望对您有用。

webpack eskitess的参考

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

醉南桥 2025-02-14 18:08:53

确保您首先在终端中的项目目录中

,在终端中键入以下内容,然后键入输入,

npm install --save-dev webpack-cli

然后输入以下输入并命中输入:

npm upgrade --save-dev webpack-cli

它应该有效

,也许您必须在创建的每个新项目中执行此操作。

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.

淡淡绿茶香 2025-02-14 18:08:53

这是您如何更新Webpack-CLI,以适应其他好奇的人。

首先,通过在IDE终端运行此命令来检查您的WebPack版本: webpack -version 。您应该看到一个出现这样的列表:

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

如果您的webpack-cli读取以下任何内容 4.10.0 ,则需要将其更新为最新版本,以使NPM与Jhipster在Localhost上正确运行。这是更新它的方法。

在您的IDE终端中运行此命令:

npm install [email protected]

[现在,最新版本是 4.10.0 ,但是对于未来的更新,在运行此命令时,请在命令行末尾更改版本要更新到当前版本:

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

然后重新运行 webpack -version ,看看您的WebPack是否已更新到您在上面输入的版本。


额外说明:

为什么有这个错误?根据 webpack.js.org :“请注意,这不是推荐的练习。安装全球锁定您进入特定版本的WebPack,并且可能会在使用不同版本的项目中失败。”

因此,如果您运行了这样的命令: npm install -Global webpack ,那么您很有可能被锁定到特定版本。这可能是错误。我相信这就是我所发生的。我运行 npm install -g 或这种性质的东西。

与上述材料相关的旅程和研究的来源:

  1. https://stackabuse.com/npm - 安装包装的特定于包装/

希望这会有所帮助!祝福你最好!

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 [email protected]

[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!

淡水深流 2025-02-14 18:08:53

在终端中运行以下代码行,它将解决您的问题。
如果您的WebPack在低于版本4.10.0

  1. npm install

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 [email protected]
就是爱搞怪 2025-02-14 18:08:53

我删除了node_modules,package-lock.json,如果有一个构建文件夹,请还删除该文件夹并运行NPM安装。
它对我有用

I deleted node_modules, package-lock.json and if there is a build folder, delete that as well and run npm install.
it worked for me

著墨染雨君画夕 2025-02-14 18:08:53

如果您使用的是纱线,则运行纱线添加webpack-cli

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

倥絔 2025-02-14 18:08:53

对我来说,这很容易
转到您的package.json文件,然后将版本从4.9.x更改为4.10
并运行NPM安装
然后运行NPM重新开始,就像魔术一样工作!

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!

旧竹 2025-02-14 18:08:53

安装WebPack-CLI版本4.10

npm i [email protected]

这可能会解决。

Install webpack-cli version 4.10

npm i [email protected]

This might work out.

雨的味道风的声音 2025-02-14 18:08:53

我删除了node_modules和package-lock.json。然后再次安装NPM。

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

赠我空喜 2025-02-14 18:08:53

将“ package-json”中的“ webpack-cli”版本更新为“ 4.10.0”,然后在终端中运行“ NPM安装”,然后运行“ NPM启动”。它对我有用。

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.

走走停停 2025-02-14 18:08:53

更新WebPack-CLI:确保已安装了最新版本的WebPack-CLI。运行以下命令将其更新:

npm install webpack-cli@最新

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

夏见 2025-02-14 18:08:53

在说NPM启动之前,请尝试编写我用星号标记的代码。

  1. dfx部署

  2. *** npm安装-Save-dev webpack-cli

  3. npm start

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

〆一缕阳光ご 2025-02-14 18:08:53

确保您在您的终端类型中处于项目目录中

的以下内容并击中输入

npm install webpack-cli

Ensure you are in your project directory in your terminal

Type the following in your terminal and hit enter

npm install webpack-cli
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文