To change this, create a directory in your home to store npm package.
For example :
mkdir ~/.npm_user_pkg
Change npm prefix to :
npm config set prefix '~/.npm_user_pkg/'
And add this to your ~/.profile to change your $PATH env variable:
export PATH="${HOME}/.npm_user_pkg/bin:$PATH"
And now, you can install npm package globally (with -g) without sudo, for your $USER.
For example :
npm install -g eslint