首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何为离子工程添加android平台

如何为离子工程添加android平台
EN

Stack Overflow用户
提问于 2018-04-15 05:59:15
回答 2查看 965关注 0票数 1

当我要添加android plaform时,遇到了这个错误。

代码语言:javascript
复制
F:\OLLE\olle>cordova platform add android
Using cordova-fetch for cordova-android@7.0.0
(node:15100) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): CordovaError: Failed to fetch platform cordova-android@7.0.0
Probably this is either a connection problem, or platform spec is incorrect.
Check your connection and platform name/version/URL.
Error: cmd: Command failed with exit code 4294963238 Error output:
npm WARN checkPermissions Missing write access to F:\OLLE\olle\node_modules\extglob
npm WARN checkPermissions Missing write access to F:\OLLE\olle\node_modules\recast

npm WARN checkPermissions Missing write access to cess to F:\OLLE\olle\node_modules\unreachable-branch-transform
Some other same errors...
npm WARN checkPermissions Missing write access to F:\OLLE\olle\node_modules\cordova-android
npm WARN checkPermissions Missing write access to F:\OLLE\olle\node_modules\ionic-angular
npm WARN checkPermissions Missing write access to F:\OLLE\olle\node_modules\ionicons
npm WARN checkPermissions Missing write access to F:\OLLE\olle\node_modules\rxjs
npm WARN The package protractor is included as both a dev and production dependency.

npm ERR! path F:\OLLE\olle\node_modules\extglob
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall access
npm ERR! enoent ENOENT: no such file or directory, access 'F:\OLLE\olle\node_modules\extglob'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2018-04-15T05_45_21_245Z-debug.log
(node:15100) [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

首先,这个命令运行良好。当我删除android平台后,当我尝试重新添加android平台时,它就出了问题。有人知道怎么修吗?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2018-04-15 06:05:28

删除Android文件夹后,rm nodemoduls,并再次添加,如果它将不工作,然后创建新的项目,粘贴src文件夹,并添加之后,所有插件工作良好。

票数 1
EN

Stack Overflow用户

发布于 2018-04-15 20:01:49

我同意@Praveen,我也会这么做:

代码语言:javascript
复制
ionic cordova platform rm android
rm -rf node_modules
ionic cordova platform add android

还记得使用cordova命令与离子。这可能会使这个过程更完整。

也可以检查您对创建项目的文件夹的权限,但可能在cordova之前添加离子型文件来修复某些问题。

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

https://stackoverflow.com/questions/49838945

复制
相关文章

相似问题

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