这是因为安装了nvm后系统还没有nodejs,解决方法:安装nodejs版本,并使用。比如: nvm install 14.20.1 nvm use 14.20.1 然后就可以使用npm命令了,nodejs版本号可自行更换。