checkPermissions Missing write access to /usr/local/lib/node_modules

字号+ 编辑: 国内TP粉 修订: SyncLWT 来源: 原创 2023-09-09 我要说两句(0)

报类似错误 Missing write access to /usr/local/lib/node_modules

有时候在mac上安装node.js模块、插件之类的东西会发现权限不够, 报类似以下的错误

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!  { [Error: EACCES: permission denied, access '/usr/local/lib/node_modules']
npm ERR!   stack:
npm ERR!    'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules' }
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 (though this is not recommended).

npm ERR! A complete log of this run can be found in:

让你检查权限。如何来做?

解决方法:

前面加个前缀sudo, 执行命令的时候输入管理员密码就ok了。

就这么简单

阅完此文,您的感想如何?
  • 有用

    1

  • 没用

    2

  • 开心

    2

  • 愤怒

    1

  • 可怜

    1

1.如文章侵犯了您的版权,请发邮件通知本站,该文章将在24小时内删除;
2.本站标注原创的文章,转发时烦请注明来源;
3.Q群: 2702237 13835667

相关课文
  • JS如何防止父节点的事件运行

  • nodejs编写一个简单的http请求客户端代码demo

  • 说一则为什么后端开发人员不选择node.js的原因

  • 使用Sublime Text3 开发React-Native的配置

我要说说
网上宾友点评