android - 我试图在 ionic 中添加 android 平台但它不起作用,它显示错误

标签 android angular ionic-framework ionic2 ionic3

我正在尝试在 ionic 中添加 android 平台但它不起作用,它显示以下错误:

C:\Users\Lenovo\Desktop\first app\RoomBooking>cordova platform add android

Using cordova-fetch for cordova-android@~6.3.0
Error: Failed to fetch platform cordova-android@~6.3.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 4294963248 Error output:
npm ERR! path C:\Users\Lenovo\Desktop\first app\RoomBooking\node_modules\.stagin
g
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'C:\Users\Lenovo\Desktop\
first app\RoomBooking\node_modules\.staging'
npm ERR!  { Error: EPERM: operation not permitted, unlink 'C:\Users\Lenovo\Deskt
op\first app\RoomBooking\node_modules\.staging'
npm ERR!   stack: 'Error: EPERM: operation not permitted, unlink \'C:\\Users\\Le
novo\\Desktop\\first app\\RoomBooking\\node_modules\\.staging\'',
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'unlink',
npm ERR!   path: 'C:\\Users\\Lenovo\\Desktop\\first app\\RoomBooking\\node_modul
es\\.staging' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Lenovo\AppData\Roaming\npm-cache\_logs\2017-11-26T21_56_46
_792Z-debug.log

我该怎么办?

最佳答案

这可能是 npm 的问题。尝试降级 npm,运行以下命令:

npm install -g npm@5.3

关于android - 我试图在 ionic 中添加 android 平台但它不起作用,它显示错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47501470/

相关文章:

ionic-framework - 如何将相机图像转换为 ionic 5 中的 blob?

java - 多个 Activity/fragment 的自定义对话框界面

html - 更改 ngx-pagination CSS

javascript - ionic 框架中带有禁用复选框的 ionic 列表

typescript - 存储不返回字符串 ionic

node.js - 使用 ng 服务器 Angular 6 运行脚本

android - Android webkit 上的 CSS3 动画问题 -iteration-count 和 'forwards' 不要停止动画

java - 如何在图片上写文字

android - 有什么方法可以从 ImageButtons 中删除灰色背景?

javascript - 如何在 Angular js 中将 JSON 嵌套字典转换为 JSON 嵌套数组?