You can more simply run one of the following commands:
Latest version:
nvm install node --reinstall-packages-from=node
Stable (LTS) version:
nvm install lts/* --reinstall-packages-from=node
This will install the appropriate version and reinstall all packages from the currently used node version. This saves you from manually handling the specific versions.
Edit - added command for installing LTS version according to @m4js7er comment.