Simply use the full path
npm
/opt/alt/alt-nodejs8/root/usr/bin/npm
node
/opt/alt/alt-nodejs8/root/usr/bin/node
Optionally, add npm and node aliases to avoid using the full path:
nano ~/.bash_profile ADD alias npm="/opt/alt/alt-nodejs8/root/usr/bin/npm" alias node="/opt/alt/alt-nodejs8/root/usr/bin/node"