npm install: Error: EACCES: permission denied, mkdir

一世执手 提交于 2019-12-09 07:14:15

问题


I attempted to do a sudo npm install -g appium on Mac OS 10.12.5.

I get this error:

info Chromedriver Install Installing Chromedriver version '2.30' 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/2017820-44752-12jfqpb.z2hd'

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! appium-chromedriver@3.0.1 install: node install-npm.js npm ERR! Exit status 1 npm ERR!

this is not a dup question, as this install attempt was with sudo, as the other one was not.


回答1:


sudo npm install -g appium --unsafe-perm=true --allow-root

Worked for me




回答2:


you are using npm so you have to use

sudo npm install --unsafe-perm
In unsafe mode with every command you run
hopefully, it will help




回答3:


I reinstalled Node/NPM. Problem solved.



来源:https://stackoverflow.com/questions/46328267/npm-install-error-eacces-permission-denied-mkdir

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!