npm install -g全局安装权限问题
全局安装 npm install nrm -g
安装 nrm
时返回错误:
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.
明显是权限问题,解决办法:
修改安装目录的权限: sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
OK👌 解决了