A check node installation path
whitch node
Second, open the configuration file
we ./.bash_profile
Third, add a line to the PATH (i enter insert according to editor)
export NODE_HOME="/usr/local"
export PATH=$PATH:$NODE_HOME/bin
Fourth, press esc to exit the insert, enter: wq, press Enter, save the file, the configuration is successful
Fifth, to see whether the configuration
npm -v
node -v