当我要添加android plaform时,遇到了这个错误。
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平台时,它就出了问题。有人知道怎么修吗?
发布于 2018-04-15 06:05:28
删除Android文件夹后,rm nodemoduls,并再次添加,如果它将不工作,然后创建新的项目,粘贴src文件夹,并添加之后,所有插件工作良好。
发布于 2018-04-15 20:01:49
我同意@Praveen,我也会这么做:
ionic cordova platform rm android
rm -rf node_modules
ionic cordova platform add android还记得使用cordova命令与离子。这可能会使这个过程更完整。
也可以检查您对创建项目的文件夹的权限,但可能在cordova之前添加离子型文件来修复某些问题。
https://stackoverflow.com/questions/49838945
复制相似问题