错误:包“@ionic/angular-toolkit”没有定义构建器

发布于 2025-01-10 06:05:43 字数 1027 浏览 0 评论 0原文


[error] Error: Package "@ionic/angular-toolkit" has no builders defined.}
at WorkspaceNodeModulesArchitectHost.resolveBuilder (C:\Users\Lenovo\Documents\krishikhoj\krishikhoj-ionic-app\node_modules\@angular-devkit\architect\node\node-modules-architect-host.js:121:19)
at RunCommand.runSingleTarget (C:\Users\Lenovo\Documents\krishikhoj\krishikhoj-ionic-app\node_modules\@angular\cli\models\architect-command.js:245:53)
at async RunCommand.runArchitectTarget (C:\Users\Lenovo\Documents\krishikhoj\krishikhoj-ionic-app\node_modules\@angular\cli\models\architect-command.js:295:24)
at async RunCommand.validateAndRun (C:\Users\Lenovo\Documents\krishikhoj\krishikhoj-ionic-app\node_modules\@angular\cli\models\command.js:136:22)
at async runCommand (C:\Users\Lenovo\Documents\krishikhoj\krishikhoj-ionic-app\node_modules\@angular\cli\models\command-runner.js:224:24)
at async default_1 (C:\Users\Lenovo\Documents\krishikhoj\krishikhoj-ionic-app\node_modules\@angular\cli\lib\cli\index.js:70:31)


[error] Error: Package "@ionic/angular-toolkit" has no builders defined.}
at WorkspaceNodeModulesArchitectHost.resolveBuilder (C:\Users\Lenovo\Documents\krishikhoj\krishikhoj-ionic-app\node_modules\@angular-devkit\architect\node\node-modules-architect-host.js:121:19)
at RunCommand.runSingleTarget (C:\Users\Lenovo\Documents\krishikhoj\krishikhoj-ionic-app\node_modules\@angular\cli\models\architect-command.js:245:53)
at async RunCommand.runArchitectTarget (C:\Users\Lenovo\Documents\krishikhoj\krishikhoj-ionic-app\node_modules\@angular\cli\models\architect-command.js:295:24)
at async RunCommand.validateAndRun (C:\Users\Lenovo\Documents\krishikhoj\krishikhoj-ionic-app\node_modules\@angular\cli\models\command.js:136:22)
at async runCommand (C:\Users\Lenovo\Documents\krishikhoj\krishikhoj-ionic-app\node_modules\@angular\cli\models\command-runner.js:224:24)
at async default_1 (C:\Users\Lenovo\Documents\krishikhoj\krishikhoj-ionic-app\node_modules\@angular\cli\lib\cli\index.js:70:31)

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

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

发布评论

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

评论(5

唱一曲作罢 2025-01-17 06:05:43

尝试安装 - npm install @ionic/cordova-builders

然后转到“ionic-cordova-build”和“ionic-cordova-serve”内的 angular.json替换

"builder": "@ionic/angular-toolkit:cordova-build"

"builder": "@ionic/cordova-builders:cordova-build"

Try to install - npm install @ionic/cordova-builders

Then goto angular.json inside "ionic-cordova-build" and "ionic-cordova-serve" and replace

"builder": "@ionic/angular-toolkit:cordova-build"

with

"builder": "@ionic/cordova-builders:cordova-build",

不回头走下去 2025-01-17 06:05:43

以下解决方案对我有用:

步骤:1

  • npm install @ionic/angular-toolkit@latest @ionic/cordova-builders

步骤:2

  • 替换 angular.json 中的以下代码

  •  "builder": "@ionic/angular-toolkit:cordova-build",
    
  •  "builder": "@ionic/cordova-builders:cordova-serve",
    

输入图像描述这里

步骤:3 - 非强制

  • 删除node_module并重新安装

输出
输入图像描述这里

Below Solution work for me:

Step: 1

  • npm install @ionic/angular-toolkit@latest @ionic/cordova-builders

Step: 2

  • Replace below code in angular.json

  •      "builder": "@ionic/angular-toolkit:cordova-build",
    
  •      "builder": "@ionic/cordova-builders:cordova-serve",
    

enter image description here

Step: 3 - Not mandatory

  • Remove node_module and reinstall

Output
enter image description here

瞄了个咪的 2025-01-17 06:05:43

我使用这个解决方案解决了这个问题。

  1. 运行
    sudo npm install -g @ionic/cli@latest
    安装最新的 ionic 包并运行
    npm 已过时
    获取过时的软件包。
  2. 运行
    对于过时软件包列表中显示的每个软件包,npm install package_name@latest --force(将“package_name”替换为过时的软件包名称)
  3. 忽略更新期间的任何警告。

    < br>
    提示:更新所有过时的软件包可以避免应用性能低下并提高安全性

I kicked out the issue by using this solution.

  1. run
    sudo npm install -g @ionic/cli@latest
    to install latest ionic package and run
    npm outdated
    to get outdated packages.
  2. run
    npm install package_name@latest --force (replace 'package_name' with the outdated package name) for every package shown in outdated package list
  3. Ignore any warning during update.

    TIP:Updating all the outdated packages saves you from app's low performance and improves security

诺曦 2025-01-17 06:05:43

供将来参考:这里有解释以及如何修复它。我还需要编辑 angular.json 来更改 cordova 构建器。

For future references: here an explanation and how to fix it. I also needed to edit the angular.json to change the cordova builder.

死开点丶别碍眼 2025-01-17 06:05:43

尝试安装 - npm install @ionic/cordova-builders

然后转到 angular.json 并替换

@ionic/angular-toolkit


@ionic/cordova-builders

The angular.json will be like this:

        "ionic-cordova-serve": {
          "builder": "@ionic/cordova-builders:cordova-serve",
          "options": {
            "cordovaBuildTarget": "app:ionic-cordova-build",
            "devServerTarget": "app:serve"
          },
          "configurations": {
            "production": {
              "cordovaBuildTarget": "app:ionic-cordova-build:production",
              "devServerTarget": "app:serve:production"
            }
          }
        },
        "ionic-cordova-build": {
          "builder": "@ionic/cordova-builders:cordova-build",
          "options": {
            "browserTarget": "app:build"
          },
          "configurations": {
            "production": {
              "browserTarget": "app:build:production"
            }
          }
        }

Try to install - npm install @ionic/cordova-builders

Then goto angular.json and replace

@ionic/angular-toolkit

with


@ionic/cordova-builders

The angular.json will be like this:

        "ionic-cordova-serve": {
          "builder": "@ionic/cordova-builders:cordova-serve",
          "options": {
            "cordovaBuildTarget": "app:ionic-cordova-build",
            "devServerTarget": "app:serve"
          },
          "configurations": {
            "production": {
              "cordovaBuildTarget": "app:ionic-cordova-build:production",
              "devServerTarget": "app:serve:production"
            }
          }
        },
        "ionic-cordova-build": {
          "builder": "@ionic/cordova-builders:cordova-build",
          "options": {
            "browserTarget": "app:build"
          },
          "configurations": {
            "production": {
              "browserTarget": "app:build:production"
            }
          }
        }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文