美文网首页
Vue npm install --save moment 安装

Vue npm install --save moment 安装

作者: Rinaloving | 来源:发表于2024-03-10 10:54 被阅读0次

问题

npm install --save moment 安装失败

解决

  • 使用 yarn add moment 安装
  yarn add moment
image.png
yarn add v1.22.19
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/5] Validating package.json...
[2/5] Resolving packages...
error An unexpected error occurred: "https://registry.npm.taobao.org/regenerator-runtime: certificate has expired".
info If you think this is a bug, please open a bug report with the information provided in "D:\\项目\\2023年\\*****\\front\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
  • 我们需要切换淘宝最新镜像地址
npm config set registry https://registry.npmmirror.com
  • 再次执行,可见成功安装


    image.png

补充

  • 其它镜像源
npm 官方原始镜像网址是:https://registry.npmjs.org/
淘宝最新 NPM 镜像:https://registry.npmmirror.com
阿里云 NPM 镜像:https://npm.aliyun.com
腾讯云 NPM 镜像:https://mirrors.cloud.tencent.com/npm/
华为云 NPM 镜像:https://mirrors.huaweicloud.com/repository/npm/
网易 NPM 镜像:https://mirrors.163.com/npm/
中科院大学开源镜像站:http://mirrors.ustc.edu.cn/
清华大学开源镜像站:https://mirrors.tuna.tsinghua.edu.cn/
腾讯,华为,阿里的镜像站基本上比较全

相关文章

网友评论

      本文标题:Vue npm install --save moment 安装

      本文链接:https://www.haomeiwen.com/subject/ctcpzdtx.html