错误:EACCES:拒绝权限,重命名'/usr/local/lib/node_modules/expo-cli'
我来了这个错误,这似乎是一个许可问题,花了我一段时间,所以我只是想分享一个我为此找到的解决方案。
如果其他解决方案?,请分享。
I came accross this error that seems to be a permission issue, took me a while so i just wanted to share a solution I found for this.
If other solutions ?, please share them.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我为此问题找到的当前解决方案是将权限更改为当前用户。
然后尝试跑步
希望这对您有用。
The current solution I found for this issue is to change the permissions to the current user.
then try running
Hope this works for you.
我遇到了同样的问题,但是在我正在进行的项目中。
奇怪的是,我第一次运行
npm i
,它起作用了,但是当我再次运行时,我会遇到相同的错误。错误的一种稍
详细
的 使用VS -CODE)
npm i
eaccess
-路径: '/users/[thepath]/[my -project]/node_modules /...
node_modules
- >/user/[thepath]/[my-project]
sudo chown -r $ user/user/[thepath]/[my-prodject]
-r
,它将递归运行,并给予npm i
工作 ;)。I had the same problem, but inside a project I was working on.
Curiously, the first time I ran
npm i
, it worked, but when I ran it again, I got the same error.Here's a slightly more detailed method for resolving the error
Make sure npm shall run
sudo chown -R $(whoami) ~/.npm
Inside your project (I'm opening it with vs-code)
npm i
EACCESS
-path: '/Users/[thePath]/[my-project]/node_modules/...
node_modules
->/Users/[thePath]/[my-project]
sudo chown -R $USER /Users/[thePath]/[my-project]
-R
and give write access to every filenpm i
again, this should work ;).首先,我确实
确定了哪些文件夹不下于我的用户并运行
First i do
Identify which folders not below to my user and run
对我来说是;
sudo chown -r“ user/mac/.npm”
进而;
NPM缓存清洁 - 力
for me it was;
sudo chown -R "User/mac/.npm"
and then;
npm cache clean --force