I've found the best way around needing sudo for global npm installs in Ubuntu is to use an .npmrc file and set a prefix for where npm installs things, then add that location to your PATH. This allows you to npm -g
without sudo. With this setup I'm running ampersand's CLI without issue (and avoiding the need to sudo npm
in general).
If you have any global modules installed, they should be uninstalled first so they are removed from the PATH. List all globally installed npm modules by running:
sudo npm -g ls -depth 0