【发布时间】:2021-12-29 17:17:04
【问题描述】:
我刚刚在我的 MAC 上安装了 node.js,然后尝试按照网络说明安装 browser-sync,但出现了这些错误,但我不知道如何修复它。你能帮我解决吗?
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules/browser-sync
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/browser-sync'
npm ERR! [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/browser-sync'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/usr/local/lib/node_modules/browser-sync'
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.```
【问题讨论】:
-
EACCES 表示创建目录时权限不足 - 正如跟踪隐含地告诉您的那样。检查您的权限并相应地设置它们。见macinstruct.com/tutorials/how-to-set-file-permissions-on-a-mac
-
@iLuvLogix,感谢您的帮助。
-
德纳达!您可以自行回答您的问题,基本上描述您为解决问题所做的工作 - 未来的访问者可能会发现这对他们遇到类似问题很有帮助.. ;)
标签: node.js npm browser-sync