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
but

$ 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

https://wiki.archlinux.org/index.php/Node.js#Node_Packaged_Modules

ok shit so now what?

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