Issues with npm

hi all

when I type in terminal:
$ npm
bash: npm: command not found

it worked yesterday.

I just reinstalled npm and nodejs in an attempt to fix the problem, still same issue.

what is going on?

ok for some reason, yesterday i had updated npm with:

sudo npm install -g npm

and now

$ npm

does not work

$ sudo npm

does work

how do i revert this, because now i have to sudo everything i install through npm

never use sudo with npm

ok shit so now what?

Use a node version manager e.g. nvm (github)