一、问题

今天在安装公司内部的一个npm模块的时候,发现报错了⬇

在用node安装某个全局模块的时候,没有权限修改node_modules

第一行错误:

deprecated graceful-fs@1.2.3: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js

第二行关键错误:

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

发现是电脑没有权限修改node_modules

二、开放node_modules的修改权限

执行命令:
sudo chown -R $USER /usr/local/lib/node_modules

再重新安装一次npm i -g xxx即可!

相关文章:

  • 2021-11-24
  • 2021-04-14
  • 2021-12-14
  • 2021-09-27
  • 2021-12-07
  • 2022-12-23
  • 2021-12-09
猜你喜欢
  • 2022-12-23
  • 2021-11-27
  • 2021-12-24
  • 2021-12-09
  • 2022-01-06
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案