程序问答   发布时间:2022-06-01  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了错误:ENOENT:运行 Ionic Cordova 平台时没有这样的文件或目录 添加 Android大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

如何解决错误:ENOENT:运行 Ionic Cordova 平台时没有这样的文件或目录 添加 Android?

开发过程中遇到错误:ENOENT:运行 Ionic Cordova 平台时没有这样的文件或目录 添加 Android的问题如何解决?下面主要结合日常开发的经验,给出你关于错误:ENOENT:运行 Ionic Cordova 平台时没有这样的文件或目录 添加 Android的解决方法建议,希望对你解决错误:ENOENT:运行 Ionic Cordova 平台时没有这样的文件或目录 添加 Android有所启发或帮助;

我就是不知道如何解决这个问题。我尝试了很多解决方案,但对我的情况没有任何作用。 所以我将我的项目放在 xampp\htdocs 中,文件夹名称为exam-ionic。

然后当我尝试添加平台 androID 时出现错误

Error: ENOENT: no such file or directory,open 'c:\xampp\htdocs\exam-ionic\androID\package.Json'] { errno: -4058,code: 'ENOENT',syscall: 'open',path: 'c:/xampp/htdocs/exam-ionic/androID/package.Json

这是我运行 ionic cordova platform add androID --verbose

ionic:utils-process onBeforeExit handler: 'process.exit' received +0ms ionic:utils-process onBeforeExit handler: running 1 functions +2ms ionic:utils-process error while killing process tree for 6724: Error: Command Failed: taskkill /pID 6724 /T /F ionic:utils-process ERROR: The process "6724" not found. ionic:utils-process ionic:utils-process at ChildProcess.exithandler (child_process.Js:308:12) ionic:utils-process at ChildProcess.emit (events.Js:315:20) ionic:utils-process at maybeClose (internal/child_process.Js:1048:16) ionic:utils-process at Process.ChildProcess._handle.onexit (internal/child_process.Js:288:5) { ionic:utils-process killed: false,ionic:utils-process code: 128,ionic:utils-process signal: null,ionic:utils-process cmd: 'taskkill /pID 6724 /T /F' ionic:utils-process } +916ms ionic:utils-process onBeforeExit handler: error from function: Error: Command Failed: taskkill /pID 6724 /T /F ionic:utils-process ERROR: The process "6724" not found. ionic:utils-process ionic:utils-process at ChildProcess.exithandler (child_process.Js:308:12) ionic:utils-process at ChildProcess.emit (events.Js:315:20) ionic:utils-process at maybeClose (internal/child_process.Js:1048:16) ionic:utils-process at Process.ChildProcess._handle.onexit (internal/child_process.Js:288:5) { ionic:utils-process killed: false,ionic:utils-process cmd: 'taskkill /pID 6724 /T /F' ionic:utils-process } +3ms ionic:utils-process processExit: exiTing (exit code: 1) +5ms

这是我的离子信息

`Ionic:

 Ionic Cli                     : 5.4.16 
 (C:\Users\User\ApPDAta\roaR_761_11845@ing\npm\node_modules\ioniC)
 Ionic Framework               : @ionic/angular 5.6.0
 @angular-devkit/build-angular : 0.1101.4
 @angular-devkit/@R_674_10906@matics    : 11.1.4
 @angular/cli                  : 11.1.4
 @ionic/angular-toolkit        : 3.1.0

 Capacitor:

 Capacitor Cli   : 2.4.7
 @capacitor/core : 2.4.7

 Cordova:

 Cordova Cli       : 10.0.0
 Cordova Platforms : none
 Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0,cordova-plugin- 
 ionic-webvIEw 4.2.1,(and 9 other plugins)

 Utility:

 cordova-res : 0.15.3
 native-run  : 1.3.0

 System:

 AndroID SDK Tools : 26.1.1 (C:\Users\User\ApPDAta\Local\AndroID\Sdk)
 NodeJs            : v14.16.1 (C:\Program files\nodeJs\node.exE)
 npm               : 7.9.0
 OS                : windows 10`

这是 package.Json

{
"name": "exam-ionic","version": "0.0.1","author": "Ionic Framework","homepage": "https://ionicframework.com/","scripts": {
"ng": "ng","start": "ng serve","build": "ng build","test": "ng test","lint": "ng lint","e2e": "ng e2e"
},"private": true,"dependencIEs": {
"@angular/common": "~11.2.0","@angular/core": "~11.2.0","@angular/forms": "~11.2.0","@angular/platform-browser": "~11.2.0","@angular/platform-browser-dynamic": "~11.2.0","@angular/router": "~11.2.0","@capacitor/androID": "^2.4.7","@capacitor/core": "2.4.7","@ionic-native/core": "^5.32.0","@ionic-native/onesignal": "^5.32.0","@ionic-native/wonderpush": "^5.32.0","@ionic/angular": "^5.5.2","@ionic/storage": "^2.3.1","cordova-plugin-androIDx": "^3.0.0","cordova-plugin-androIDx-adapter": "^1.1.3","cordova-sqlite-storage": "^5.1.0","ionic-context-menu": "^5.0.0","onesignal-cordova-plugin": "^2.11.3","rxJs": "~6.6.0","tslib": "^2.0.0","wonderpush-cordova-sdk": "^3.0.3","wonderpush-cordova-sdk-fcm": "^1.0.1","zone.Js": "~0.10.2"
},"devDependencIEs": {
"@angular-devkit/build-angular": "~0.1101.4","@angular/cli": "~11.1.4","@angular/compiler": "~11.2.0","@angular/compiler-cli": "~11.2.0","@angular/language-service": "~11.2.0","@capacitor/cli": "2.4.7","@ionic/angular-toolkit": "^3.1.0","@ionic/lab": "3.2.10","@types/jasmine": "~3.6.0","@types/jasminewd2": "~2.0.3","@types/node": "^12.11.1","codelyzer": "^6.0.0","cordova-plugin-device": "^2.0.2","cordova-plugin-ionic-keyboard": "^2.2.0","cordova-plugin-ionic-webview": "^4.2.1","cordova-plugin-splashscreen": "^5.0.2","cordova-plugin-statusbar": "^2.4.2","cordova-plugin-whiteList": "^1.3.3","jasmine-core": "~3.6.0","jasmine-spec-reporter": "~5.0.0","karma": "~5.2.0","karma-Chrome-launcher": "~3.1.0","karma-coverage": "~2.0.3","karma-coverage-istanbul-reporter": "~3.0.2","karma-jasmine": "~4.0.0","karma-jasmine-HTML-reporter": "^1.5.0","protractor": "~7.0.0","ts-node": "~8.3.0","tslint": "~6.1.0","typescript": "~4.0.2"
 },"description": "An Ionic project","cordova": {
"plugins": {
  "cordova-sqlite-storage": {},"cordova-plugin-whiteList": {},"cordova-plugin-statusbar": {},"cordova-plugin-device": {},"cordova-plugin-splashscreen": {},"cordova-plugin-ionic-webview": {
    "ANDROID_SUPPORT_AnnOTATIONS_VERSION": "27.+"
  },"cordova-plugin-ionic-keyboard": {},"onesignal-cordova-plugin": {},"wonderpush-cordova-sdk": {
    "CLIENT_ID": "a312c22bafed82635f3167cc71a7437a9b840c44","CLIENT_SECRET": 
  "e499dc98a572d63752da6b73494ff8bf3bc99cf04a64bfc5451fbdce52854547"
  },"wonderpush-cordova-sdk-fcm": {
    "CLIENT_ID": "a312c22bafed82635f3167cc71a7437a9b840c44","CLIENT_SECRET": 
  "e499dc98a572d63752da6b73494ff8bf3bc99cf04a64bfc5451fbdce52854547","SENDER_ID": "default"
  },"cordova-plugin-androIDx": {},"cordova-plugin-androIDx-adapter": {}
  },"platforms": []
  }
  }

我尝试重新安装 npm、重新安装cordova、更新ionic Cli、删除node_module 文件夹+ package.lock.Json 然后安装npm,但没有任何效果。请帮帮我

解决方法

我运行时遇到了同样的错误,今天我找到了解决方案。 以前试过一个电容插件,但是我的项目是cordova,所以从我的项目中去掉了。但我认为有些文件没有正确删除,当我运行 ionic repair 时,问题开始了。 因此,为了修复此问题,我删除了项目根目录下的 ANDROID 文件夹、根目录下与 Capacitor 相关的所有文件、编辑了 package.json 并删除了与 Capacitor 相关的所有内容,然后一切正常。

,

我在 android 文件夹中遇到了同样的问题。我解决了它: - 我的ionic版本是5.4.0

  1. 手动删除platform/android文件夹

  2. 运行以下命令:

  3. 离子科尔多瓦rm android

  4. 离子科尔多瓦添加安卓

大佬总结

以上是大佬教程为你收集整理的错误:ENOENT:运行 Ionic Cordova 平台时没有这样的文件或目录 添加 Android全部内容,希望文章能够帮你解决错误:ENOENT:运行 Ionic Cordova 平台时没有这样的文件或目录 添加 Android所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签:添加