首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >离子4平台添加android错误代码ENOLOCAL

离子4平台添加android错误代码ENOLOCAL
EN

Stack Overflow用户
提问于 2018-09-26 08:19:04
回答 3查看 5.6K关注 0票数 10

我删除了我的离子项目的安卓平台,并试图重新安装它,但我一直收到npm ERR! code ENOLOCAL。以下是输入platform add android时的错误

代码语言:javascript
复制
(node:3880) UnhandledPromiseRejectionWarning: CordovaError: Error: cmd: Command failed with exit code 1 Error output:
npm ERR! code ENOLOCAL
npm ERR! Could not install from "android" as it does not contain a package.json file.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\RMT016\AppData\Roaming\npm-cache\_logs\2018-09-26T08_08_46_485Z-debug.log
    at C:\Users\RMT016\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-fetch\index.js:105:29
    at _rejected (C:\Users\RMT016\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:864:24)
    at C:\Users\RMT016\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:890:30
    at Promise.when (C:\Users\RMT016\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:1142:31)
    at Promise.promise.promiseDispatch (C:\Users\RMT016\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:808:41)
    at C:\Users\RMT016\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:624:44
    at runSingle (C:\Users\RMT016\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:137:13)
    at flush (C:\Users\RMT016\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:125:13)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)
(node:3880) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:3880) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate
the Node.js process with a non-zero exit code.

我尝试删除和添加平台,也删除和添加node_modules,但仍然得到相同的错误。我的科多瓦版本是8.0。有人知道怎么解决这个问题吗?

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2018-09-26 08:40:41

在根目录(而不是平台目录)中创建了Android文件夹,删除该文件夹后,命令再次工作。

票数 50
EN

Stack Overflow用户

发布于 2020-10-17 15:14:02

从项目目录中删除Android文件夹

票数 3
EN

Stack Overflow用户

发布于 2020-05-16 10:24:59

我不小心运行电容命令而不是使用科多瓦。删除了用电容命令创建的android程序后,它再次工作。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52513103

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档