[Solved] Failed to install Matrix-CLI

I’m trying to install Matrix-CLI, on Ubuntu 16.04.3.
Node -v6.12.3
npm -v5.6.0

I’ve uninstalled and reinstalled Node,

I am receiving this error:
$ sudo npm install -g matrix-cli
npm ERR! code 1
npm ERR! Command failed: /usr/bin/git clone -q https://github.com/matrix-io/matrix-app-config-helper.git /home/dev/.npm/_cacache/tmp/git-clone-bffb393a
npm ERR! /home/dev/.npm/_cacache/tmp/git-clone-bffb393a/.git: Permission denied
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR! /home/dev/.npm/_logs/2018-02-06T01_47_01_584Z-debug.log

Thank you

You shouldn’t need sudo.
npm install -g matrix-cli

This link has tips to help address permission issues:
https://docs.npmjs.com/getting-started/fixing-npm-permissions

Try reinstalling npm, then rerun the install commands.

I guess I was using an outdated version of npm I ran

npm install npm@latest -g

And it worked after that.