Error install adonis on ubuntu,(indonesia)

npm ERR! Error: EACCES: permission denied, access ‘/usr/local/lib’
npm ERR! { Error: EACCES: permission denied, access ‘/usr/local/lib’
npm ERR! errno: -13,
npm ERR! code: ‘EACCES’,
npm ERR! syscall: ‘access’,
npm ERR! path: ‘/usr/local/lib’ }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

1 Like

Can you please share more details (command, …)?

I’m not an expert on Linux, but if you add sudo before your command, does it work?

Welcome to our community :slight_smile:

thnk aim use sudo npm

Watching files for changes…

1 Like

try this command in the path of file “sudo chmod -R 777 ./”

1 Like

Don’t run NPM with sudo or as root. It basically means you trust your computer to everyone whose package you install (even to all subpackages). There have been bugs where running npm as sudo have bricked whole computer / server. Can’t remember exact version, but some NPM version accidentally took ownership of everything if computer, since there was typo in command… Running such thing as sudo or root is really dangerous and destructive

chmod 777is not a good idea either, it means that everyone and everything can read, write and execute all files and folders in directory

Not familiar with Mac, but when you installed Node and NPM on Linux and you need sudo to run it, then something is really wrong with your installation. I’d recommend to use to manage Node and it’s versions

1 Like