[英]Installing expo-cli with EACCES symlink error
I'm trying to install expo-cli using npm install -g expo-cli
, however come across this issue.我正在尝试使用
npm install -g expo-cli
,但是遇到了这个问题。 I've looked at other posts and they have similar issues but the syscall seems to be different.我看过其他帖子,他们有类似的问题,但系统调用似乎不同。 Any solutions recommended by them does not seem to work.
他们推荐的任何解决方案似乎都不起作用。 I believe it has something to do with how npm was installed, however unsure how to continue.
我相信这与 npm 的安装方式有关,但不确定如何继续。 Running
npm list -g
returns the following:运行
npm list -g
返回以下内容:
/usr/local/lib
└─┬ npm@6.14.5
shouldn't that be under /usr/local/lib/node
?那不应该在
/usr/local/lib/node
下吗?
The error I get is as follows:我得到的错误如下:
npm ERR! code EACCES
npm ERR! syscall symlink
npm ERR! path ../lib/node_modules/expo-cli/bin/expo.js
npm ERR! dest /usr/local/bin/expo
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/expo-cli/bin/expo.js' -> '/usr/local/bin/expo'
npm ERR! [OperationalError: EACCES: permission denied, symlink '../lib/node_modules/expo-cli/bin/expo.js' -> '/usr/local/bin/expo'] {
npm ERR! cause: [Error: EACCES: permission denied, symlink '../lib/node_modules/expo-cli/bin/expo.js' -> '/usr/local/bin/expo'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'symlink',
npm ERR! path: '../lib/node_modules/expo-cli/bin/expo.js',
npm ERR! dest: '/usr/local/bin/expo'
npm ERR! },
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'symlink',
npm ERR! path: '../lib/node_modules/expo-cli/bin/expo.js',
npm ERR! dest: '/usr/local/bin/expo'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
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! /Users/my_user_name/.npm/_logs/2020-07-07T22_13_27_629Z-debug.log
Try this - sudo npm install --unsafe-perm -g expo-cli
It works for me试试这个 -
sudo npm install --unsafe-perm -g expo-cli
它对我有用
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.