错误:包“@ionic/angular-toolkit”没有定义构建器
[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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
尝试安装 - 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",
以下解决方案对我有用:
替换 angular.json 中的以下代码
Below Solution work for me:
Replace below code in angular.json
我使用这个解决方案解决了这个问题。
sudo npm install -g @ionic/cli@latest
安装最新的 ionic 包并运行
npm 已过时
获取过时的软件包。
对于过时软件包列表中显示的每个软件包,
npm install package_name@latest --force
(将“package_name”替换为过时的软件包名称)< br>
提示:更新所有过时的软件包可以避免应用性能低下并提高安全性
I kicked out the issue by using this solution.
sudo npm install -g @ionic/cli@latest
to install latest ionic package and run
npm outdated
to get outdated packages.
npm install package_name@latest --force
(replace 'package_name' with the outdated package name) for every package shown in outdated package listTIP:Updating all the outdated packages saves you from app's low performance and improves security
供将来参考:这里有解释以及如何修复它。我还需要编辑 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.
尝试安装 - npm install @ionic/cordova-builders
然后转到 angular.json 并替换
为
Try to install - npm install @ionic/cordova-builders
Then goto angular.json and replace
with