Solution:
npm config set registry https://registry.npmjs.org
Tip: Then you need to enter the user name, password, and email address once, which are all the information when you register npm. Later, when you enter the password, you find that you can’t enter it anyway. After a lot of work, you find that the password is hidden.