繁体   English   中英

在 mac 上全局安装 yarn

[英]installing yarn globally on mac

我有一个 Imac,我尝试使用 npm 全局安装纱线,但出现以下错误:

npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules/yarn
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/yarn'
npm ERR!  [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/yarn'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: '/usr/local/lib/node_modules/yarn'
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/user/.npm/_logs/2021-12-01T13_55_41_980Z-debug.log

我试过 sudo 但它需要密码,注意这是一个新系统,没有设置任何密码,我研究过是否有类似的问题,但没有发现任何问题。 如果您确实有解决此问题的方法,如果您能帮助我解决这个问题,我将不胜感激。 谢谢..

您可以尝试使用空白密码吗?

UNIX 基础系统总是有一个 root 用户,而且他们往往没有密码,当它首先设置时。 因此,当控制台要求您输入密码时,只需按 ENTER。

该错误甚至说您的权限不足。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM