I've installed node.js version 5.0 with
npm install grunt-cli bower yo yoman-angular-generator blablablablablabla...
This should work:
nvm install NEW_VERSION --reinstall-packages-from OLD_VERSION
then, if you want, you can delete your previous version with:
nvm uninstall OLD_VERSION
Where, in your case, NEW_VERSION = 5.4 OLD_VERSION = 5.0