I am trying to install truffle and when I run the mentioned command, I get this error:
$npm install -g truffle
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/truffle
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
/usr/local/lib
`-- truffle@4.1.14
npm ERR! Linux 4.15.0-39-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "truffle"
npm ERR! node v8.10.0
npm ERR! npm v3.5.2
npm ERR! path /usr/local/lib/node_modules/truffle
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules/truffle'
npm ERR! { Error: EACCES: permission denied, access '/usr/local/lib/node_modules/truffle'
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules/truffle' }