The reason for the above problems is that the default installation environment of node is abroad, and if the access speed is slow, it will get stuck.
Solution one:
1. Use the mirror address of taobao, enter cmd and enter:
npm config set registry https://registry.npm.taobao.org
2. Check whether the installation is successful:
npm config get registry
3. Continue to enter the previous npm install command to install.
npm install
Solution two:
input the command:
cnpm install