0

enter image description here

I am having issues trying to install nestJS for my MacBook and this error keeps popping up in my terminal when I use $ npm install -g @nestjs/cli . Am I doing something wrong or am I not putting this command line in the right place? Please help :)

Zubair Saif
  • 1,106
  • 1
  • 14
  • 29

1 Answers1

4

Running the command as sudo is only a temporary solution as you generally want to have access to this directory as a regular user and you will undoubtedly run into future issues working with node_modules.

The right approach is to change the ownership on this directory so you don't need to use elevated permissions to interact with it.

sudo chown -R $USER /usr/local/lib/node_modules

Jesse Carter
  • 20,062
  • 7
  • 64
  • 101