为当前账户添加node_modules目录读写权限即可。

1
sudo chown -R $(whoami) ~/.npm