你好,我是悦创。
我的博客网站阅读更佳:https://bornforthis.cn/blog/vuepress/08.html
默认的官方镜像:https://registry.npmjs.org,切换国内淘宝镜像,访问下载更快。
::: code-tabs
npm config get registry npm config set registry https://registry.npmmirror.com/ npm config set registry https://registry.npmjs.org/ # 上面那种设置是全局的,以后每次都会自动读取已经设置好的源,如果只是一次性使用,可以使用下面的命令 npm --registry https://registry.npmmirror.com install XXX(模块名) yarn config get registry yarn config set registry https://registry.npmmirror.com yarn config set registry https://registry.yarnpkg.com pnpm config get registry pnpm config set registry https://registry.npmmirror.com pnpm config set registry https://registry.npmjs.org npm 修改了下载源,仍然是之前的下载源。或者下载失败、下载到某处停止不动。可以进行如下操作。
node_modules 文件夹以及 package-lock.json 文件删除。