android - 通过 npm 安装 Appium 会抛出“permission denied”类型的错误
问题描述
尝试为 node.js 安装 appium 包并引用了一个问题,即权限被拒绝给 mkdir
我尝试以不同的方式运行此命令,并且以 root 用户身份运行并没有太大变化。以前有人遇到过这样的错误吗?
Dmytros-MacBook-Pro:~ root# npm install -g appium
/usr/local/bin/appium ->
/usr/local/lib/node_modules/appium/build/lib/main.js
> appium-chromedriver@4.0.0 install
/usr/local/lib/node_modules/appium/node_modules/appium-chromedriver
> node install-npm.js
(node:8302) UnhandledPromiseRejectionWarning: Error: EACCES:
permission denied, mkdir
'/usr/local/lib/node_modules/appium/node_modules/appium-
chromedriver/201866-8302-85r6wr.u3tan'
(node:8302) 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:8302) [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.
info Chromedriver Install Installing Chromedriver version '2.38' for
platform 'mac' and architecture '64'
info Chromedriver Install Opening temp file to write
chromedriver_mac64 to...
Error: EACCES: permission denied, mkdir
'/usr/local/lib/node_modules/appium/node_modules/appium-
chromedriver/201866-8302-y2j8ui.tqs2'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! appium-chromedriver@4.0.0 install: `node install-npm.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the appium-chromedriver@4.0.0 install script.
npm ERR! This is probably not a problem with npm. There is likely
additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /var/root/.npm/_logs/2018-07-07T02_06_56_333Z-debug.log
解决方案
推荐阅读
- javascript - Javascript按钮幻灯片
- java - 如何在 Log4j2 中自定义或删除默认属性 - JSON 布局
- python - pandas pivot_table 的边距仅垂直聚合
- python - ModuleErrorNotFound:没有名为“nltk”的模块
- postgresql - 在 Postgres 10.6 中,CASE 中不允许设置返回函数
- java - 在根项目中找不到任务“generateApolloSources”
- c++ - 完美转发解释为右值引用
- azure-cosmosdb - 为什么通过 ARM 模板部署 Azure Cosmos DB (SQL API) 需要这么长时间?
- java - 在 Java 中创建随机数生成器 - 每次重置数组
- python - 使用 Python 从文本中提取值