当前位置: 首页 > 知识库问答 >
问题:

'NPM错误!无法从“Android”安装,因为它不包含package.json文件。\n'+

逄嘉木
2023-03-14

我无法执行下面的命令,并且根据主题标题有错误。PLS帮助

npm错误!此运行的完整日志可以在:npm err!C:\users\jj\appdata\roaming\npm-cache_logs\2020-07-31t14_32_53_529z-debug.log at childprocess.whendone(C:\users\jj\appdata\roaming\npm\node_modules\cordova\node_modules\cordova\cordova-common\src\superspawn.js:135:23)at childprocess.emit(Events.js:315:20)at childprocess.cp.emit internal/child_process.js:1021:16)在process.childprocess._handle.onexit(internal/child_process.js:286:5){stderr:'npm err!code enolocal\n'+'npm err!无法从“Android”安装,因为它不包含package.json文件。\n'+'\n'+'npm err!可以在:\n'+'npm err!C:\users\jj\appdata\roaming

下面是我的package.json文件

{
    "name": "Bentograms",
    "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": "~9.1.6",
   "@angular/core": "~9.1.6",
   "@angular/fire": "^6.0.2",
   "@angular/forms": "~9.1.6",
   "@angular/platform-browser": "~9.1.6",
    "@angular/platform-browser-dynamic": "~9.1.6",
    "@angular/router": "~9.1.6",
    "@capacitor/android": "^2.3.0",
    "@capacitor/core": "2.3.0",
    "@ionic-native/camera": "^5.27.0",
    "@ionic-native/core": "^5.0.7",
    "@ionic-native/facebook": "^5.27.0",
    "@ionic-native/file": "^5.27.0",
   "@ionic-native/file-path": "^5.27.0",
    "@ionic-native/google-plus": "^5.27.0",
   "@ionic-native/ionic-webview": "^5.27.0",
   "@ionic-native/native-storage": "^5.22.0-beta-1",
   "@ionic-native/splash-screen": "^5.0.0",
   "@ionic-native/status-bar": "^5.0.0",
  "@ionic/angular": "^5.0.0",
  "@ionic/storage": "^2.3.0",
  "cordova-browser": "^6.0.0",
   "cordova-plugin-camera": "^4.1.0",
   "cordova-plugin-facebook4": "^6.4.0",
   "cordova-plugin-file": "^6.0.2",
   "cordova-plugin-googleplus": "^8.5.0",
   "cordova-plugin-nativestorage": "^2.3.2",
   "exif-js": "^2.3.0",
   "firebase": "^7.16.0",
   "rxjs": "~6.5.1",
   "tslib": "^1.10.0",
   "zone.js": "~0.10.2"
 },
  "devDependencies": {
   "@angular-devkit/build-angular": "~0.901.5",
    "@angular/cli": "~9.1.5",
    "@angular/compiler": "~9.1.6",
   "@angular/compiler-cli": "~9.1.6",
    "@angular/language-service": "~9.1.6",
     "@capacitor/cli": "2.3.0",
    "@ionic/angular-toolkit": "^2.1.1",
    "@types/jasmine": "~3.5.0",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "^12.11.1",
     "codelyzer": "^5.1.2",
    "jasmine-core": "~3.5.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~5.0.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~2.1.0",
    "karma-jasmine": "~3.0.1",
    "karma-jasmine-html-reporter": "^1.4.2",
    "protractor": "~5.4.3",
    "ts-node": "~8.3.0",
    "tslint": "~6.1.0",
   "typescript": "~3.8.3"
  },
   "description": "An Ionic project",
   "cordova": {
      "plugins": {
        "cordova-plugin-googleplus": {
         "REVERSED_CLIENT_ID": "com.googleusercontent.apps.871006065561-1u6n3q4iav5486cjc1kg3djl7410p873"
    },
      "cordova-plugin-nativestorage": {},
      "cordova-plugin-camera": {},
      "cordova-plugin-file": {}
    }
  }
}

共有1个答案

牧熙云
2023-03-14

删除根目录中的“Android”文件夹。

再次运行该命令:

ionic cordova platform add android
 类似资料:
  • 问题内容: 我正在尝试在我的项目上安装Grunt。它曾经可以完美地运行,但是现在由于某种原因,它并没有。每次我尝试安装Grunt时,都会出现此错误: 奇怪的是丢失的包每次都会更改。 我尝试验证缓存,删除文件夹,使用清理缓存。卸载NPM和NodeJS,重新启动计算机。没有机会 出于安全原因,我不得不格式化计算机,我使用了项目文件夹,但没有使用该文件夹,我不知道这是否有影响,但是自从我重新安装NPM后

  • 问题内容: 我正在尝试运行,但始终给我一个错误“ 无法打开包含文件:’config- win.h’ ”。 在我的Mac和另一台Windows机器上,该安装工作正常,但在此机器上却不能。我已经下载了Visual Studio C ++,并尝试同时安装32位和64位。 问题答案: 对于64位Windows 使用滚轮安装 从 http://www.lfd.uci.edu/~gohlke/pythonli

  • 问题内容: 我正在尝试安装npm软件包(node-xmpp-server),但安装失败。以前,当我尝试安装全局安装而不是本地安装的软件包时,现在却根本没有安装。 请帮帮我。 npm install node-xmpp-server 错误是:npm ERR!errno -4048 npm错误!Windows_NT 6.3.9600 npm错误!argv“ c:\ Program Files \ no

  • 我试图安装npm包(node-xmpp-server),但它未能安装。以前,当我试图安装一个包,是安装全局而不是本地,但现在它根本没有安装。 npm安装节点xmpp服务器 错误为:npm ERR!errno-4048 npm错误!Windows NT 6.3。9600 npm错误!argv“c:\Program Files\nodejs\node.exe”“c:\Program Files\nod

  • 我试图运行< code > pip install MySQL-python connector ,但它一直给我一个错误“无法打开包含文件:' config-win.h '”。 安装在我的Mac电脑和另一台Windows电脑上运行良好,但这台电脑不行。我已经下载了Visual Studio C,并尝试安装为32位和64位。