If you are facing this issue on you Mac. Follow these steps
First checking who is owner of this file by using below command
ls -la /usr/local/lib/node_modules
you will find some file like below one of them is below
drwxr-xr-x 3 root wheel 768 May 29 02:21 node_modules
have you notice that above file is own by root, for make changes inside for you need to change owner ship of path.
you can use check who is current user by this command
id -un (in my case user is yamsol)
and then you can change by calling this command (just replace your user name with ownerName)
sudo chown -R ownerName: /usr/local/lib/node_modules
in my case as you know user is "yamsol" i will call this command in this way
sudo chown -R yamsol: /usr/local/lib/node_modules
thats it.