我无法执行以下命令,并且根据主题标题出现错误 .pls help
离子科尔多瓦平台添加安卓 离子科尔多瓦添加安卓 离子科尔多瓦准备安卓
SC:\Users\jj\Desktop\bento academy\Bentograms> ionic cordova platform add android
cordova.cmd 平台添加 android 错误:npm:命令失败,退出代码为 1 错误输出:npm ERR!代码 ENOLOCAL npm ERR!无法从“android”安装,因为它不包含 package.json 文件。
npm 错误!可以在以下位置找到此运行的完整日志:npm ERR!
C:\Users\jj\AppData\Roaming\npm-cache_logs\2020-07-31T14_53_29_466Z-debug.log at ChildProcess.whenDone (C:\Users\jj\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova- common\src\superspawn.js:135:23) 在 ChildProcess.emit (events.js:315:20) 在 ChildProcess.cp.emit (C:\Users\jj\AppData\Roaming\npm\node_modules\cordova\node_modules \cross-spawn\lib\enoent.js:34:29) at mayClose (internal/child_process.js:1021:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) { stderr: 'npm 错误!代码 ENOLOCAL\n' + 'npm ERR! 无法从“android”安装,因为它不包含 package.json 文件。\n' + '\n' + 'npm ERR!可以在以下位置找到此运行的完整日志:\n' + 'npm ERR! C:\Users\jj\AppData\Roaming\npm-cache\_logs\2020-07-31T14_53_29_466Z-debug.log\n',代码:
PS C:\Users\jj\Desktop\bento academy\Bentograms> ionic cordova prepare android ? 未安装平台android!您要安装它吗?是的
cordova.cmd 平台添加 android --save 错误:npm:命令失败,退出代码 1 错误输出:npm ERR!代码 ENOLOCAL npm ERR!无法从“android”安装,因为它不包含 package.json 文件。
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- common\src\superspawn.js:135:23) 在 ChildProcess.emit (events.js:315:20) 在 ChildProcess.cp.emit (C:\Users\jj\AppData\Roaming\npm\node_modules\cordova\node_modules \cross-spawn\lib\enoent.js:34:29) at mayClose (internal/child_process.js:1021:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) { stderr: 'npm 错误!代码 ENOLOCAL\n' + 'npm ERR! 无法从“android”安装,因为它不包含 package.json 文件。\n' + '\n' + 'npm ERR!可以在以下位置找到此运行的完整日志:\n' + 'npm ERR! C:
这是我的 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": {}
}
}
}
Run Code Online (Sandbox Code Playgroud)
Dab*_*bel 11
删除根目录下的“android”文件夹。
再次运行命令:
ionic cordova platform add android
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2710 次 |
| 最近记录: |