windows10安装appium-doctor报错解决办法

windows10安装appium环境执行cnpm -g install appium-doctor命令报错。
报错信息:

C:\Users\Administrator>cnpm -g install appium-doctor
npm WARN deprecated authorize-ios@1.2.1: Moved into appium
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm ERR! code EPERM
npm ERR! syscall mkdir
npm ERR! path C:\Program Files\nodejs\node_modules\.staging
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\.staging'
npm ERR!  [OperationalError: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\.staging'] {
npm ERR!   cause: [Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\.staging'] {
npm ERR!     errno: -4048,
npm ERR!     code: 'EPERM',
npm ERR!     syscall: 'mkdir',
npm ERR!     path: 'C:\\Program Files\\nodejs\\node_modules\\.staging'
npm ERR!   },
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: 'C:\\Program Files\\nodejs\\node_modules\\.staging',
npm ERR!   parent: '@jimp/png'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2021-05-31T07_52_21_306Z-debug.log

下面是报错信息的截图:
在这里插入图片描述
下面说解决问题的过程:
1、先找到nodejs文件夹所在位置。使用cnpm -v命令可以看到nodejs的文件夹的path路径(如果没有这个命令,就自己去找吧,默认安装位置在C:\Program Files下面)。
在这里插入图片描述
2、找到nodejs文件夹(默认安装位置在C:\Program Files下面)-鼠标右击nodejs文件夹-属性-安全…。见下图:
在这里插入图片描述
将文件夹属性改为完全控制后,在安装appium-doctor,执行cnpm -g install appium-doctor命令可以发现执行成功没有报错了:
在这里插入图片描述
在学习过程中有遇到疑问的,可以appium+python QQ群交流:980 576 512

  • 3
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值