【发布时间】:2021-03-27 04:59:33
【问题描述】:
我正在尝试使用 npm install -g expo-cli 安装 expo-cli,但是遇到了这个问题。我看过其他帖子,他们有类似的问题,但系统调用似乎不同。他们推荐的任何解决方案似乎都不起作用。我相信这与 npm 的安装方式有关,但不确定如何继续。运行 npm list -g 会返回以下内容:
/usr/local/lib
└─┬ npm@6.14.5
不应该在/usr/local/lib/node下面吗?
我得到的错误如下:
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
【问题讨论】:
-
更新:我尝试在没有全局标签的情况下安装它,所以实际上它似乎是一个问题。
标签: node.js npm npm-install