What can I do for that I set up nodejs of Mac from the website but when I install it and input "npm-v" into the terminal ,the output is "-bash: npm-v: command not found"?
You have to type npm -v (note the space after npm).
npm -v
npm
try adding space, so your command would be npm -v