先看报错信息
npm ERR! code E403
npm ERR! 403 403 Forbidden - PUT https://registry.npmmirror.com/-/user/org.couchdb.user:lanxuanzzz - [FORBIDDEN] Public registration is not allowed
npm ERR! 403 In most cases, you or one of your dependencies are requesting
npm ERR! 403 a package version that is forbidden by your security policy, or
npm ERR! 403 on a server you do not have access to.
npm ERR! A complete log of this run can be found in:
npm ERR! D:\nodejs\node_cache\_logs\2022-09-12T11_43_28_087Z-debug.log
PS C:\Users\Administrator\Desktop\node.js> npm adduser
原因
经过一顿检查,发现是镜像错误.
解决办法
执行换镜像命令切回正常即可.
npm config set registry https://registry.npmjs.org/