npm, yarn查看源和换源:
npm config get registry // 查看npm当前镜像源
npm config set registry https://registry.npmmirror.com // 设置npm镜像源为淘宝镜像
yarn config get registry // 查看yarn当前镜像源
yarn config set registry https://registry.npmmirror.com // 设置yarn镜像源为淘宝镜像
macOS、Linux 系统可以使用 rm 命令进行删除。
rm -r node_modules
在vue中创建vue-demo提示源错误
vue create vue-demo
❌ERROR Failed to get response from https://registry.npm.taobao.org/vue-cli-version-marker
解决方案:卸载vue cli,替换npm 的源,再npm install -g @vue/cli
npm uninstall -g @vue/cli
npm cache clean --force
npm install -g @vue/cli
参考链接:https://blog.csdn.net/HermitSun/article/details/104524141