Angular installation on Ubuntu 20.04

Hey Guys,

I’m trying to run my partner’s angular project on my Ubuntu machine. And i’m having trouble setting up the program on my device.

Here’s the screenshot of what it says :
(I’ve tried changing around the permission, doesn’t allow)

This is a common error that can occur with any package you try to install globally on a Linux machine.

The error is related to the fact your trying to install packages (@angular/cli) globally into a directory your user doesn’t have access to (/user/local). There are a few ways to get around this.

This is a fairly common problem, so much so there is an official guide provided by npm on how to fix this issue:

TLDR:

  • Use an node* version manager, which not only keeps you from having to deal with different versions but also helps fix this permissions issue when dealing with global installations

  • manually update where globally installed npm packages are installed to be under your user’s directory, where they have permissions.

  • use npx and a locally installed version of the package (doesn’t make much sense for the @angular/cli tho)

Thanks dude! I was able to figure it out and see that the program runs