When a software update changes folder permissions we can lose access to Node.js module locations.
In case of the error message
Error: EACCES: permission denied, rename ‘/usr/local/lib/node_modules
- Change the folder permission with
sudo chown -R $USER /usr/local/lib/node_modules