cnpm发布包后下载失败,Install fail! Error: GET https://registry.npm.taobao.org/xxx response 404 status

最近写了一个vue插件,发布到npm后,准备测试一下看是否能成功下载使用,使用cnpm一直下载不成功,一直报404错误:
在这里插入图片描述
于是换为npm i nav-follows -S,也是报错:
在这里插入图片描述
然后也清除了npm缓存,问题依然没解决,最后发现是在发布npm包的时候使用了淘宝镜像,而不是npm仓库,

解决方法:

首先查看目前是否使用淘宝镜像

E:\Vue\component>npm config get registry
https://registry.npm.taobao.org

如果是则切换为npm仓库:

npm config set registry https://registry.npmjs.org

然后重新登录npm,依次输入用户名,密码,邮箱:

E:\Vue\component>npm login
Username: xxxxxx
Password:
Email: (this IS public) test@qq.com
Logged in as xxxxxx on https://registry.npmjs.org/.

此时可以通过登录成功的信息看出是否为npm仓库还是cnpm淘宝镜像,在package.json修改版本号后再从重新使用命令发布包

在这里插入图片描述

发布成功后,再重新下载包就可以了
在这里插入图片描述

  • 5
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 9
    评论
全志R16平台编译linux系统V1.0.txt 2017/4/11 13:36 (编译请使用编译android的lichee的选项编译生成的.config文件,不然直接编译会报错!!!!) rootroot@cm-System-Product-Name:/home/wwt/linux_r16$ tar zxvf lichee_parrotv1.1_20161202.tar.gz rootroot@cm-System-Product-Name:/home/wwt/linux_r16$ cd lichee/ rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ ./build.sh config Welcome to mkscript setup progress All available chips: 0. sun8iw5p1 Choice: 0 All available platforms: 0. android 1. dragonboard 2. linux 3. tina Choice: 2 All available kernel: 0. linux-3.4 Choice: 0 All available boards: 0. bell-one 1. evb 2. evb-20 3. evb-30 4. evb-rtl8723bs 5. sc3813r Choice: 3 rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ ./build.sh 错误1: KCONFIG_AUTOCONFIG=/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/buildroot-config/auto.conf KCONFIG_AUTOHEADER=/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/buildroot-config/autoconf.h KCONFIG_TRISTATE=/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/buildroot-config/tristate.config BUILDROOT_CONFIG=/home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/.config /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/buildroot-config/conf --silentoldconfig Config.in # # make dependencies written to .auto.deps # ATTENTION buildroot devels! # See top of this file before playing with this auto-preprequisites! # make[1]:正在离开目录 `/home/wwt/linux_r16/lichee/buildroot' You must install 'makeinfo' on your build machine makeinfo is usually part of the texinfo package in your distribution make: *** [dependencies] 错误 1 make:离开目录“/home/wwt/linux_r16/lichee/buildroot” ERROR: build buildroot Failed rootroot@cm-System-Product-Name:/home/wwt/linux_r16/lichee$ d/buildroot-config/conf.o /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buildroot/build/buildroot-config/zconf.tab.o -o /home/wwt/linux_r16/lichee/out/sun8iw5p1/linux/common/buil
### 回答1: "cnpm" 是一个 npm 的镜像,通过使用 "--registry=https://registry.npm.taobao.org" 参数,你可以将其安装到全局环境,以使用淘宝 NPM 镜像服务器上的资源。 执行以下命令可以安装 cnpm: ``` npm install -g cnpm --registry=https://registry.npm.taobao.org ``` ### 回答2: npm install -g cnpm --registry=https://registry.npm.taobao.org 是一个用于安装 cnpm 的命令。 cnpm 是一个用于管理 Node.js 包的工具,与 npm 类似,但可以在中国地区提供更快速可靠的下载速度。npm 是官方的 Node.js 包管理器,但由于国内网络环境的限制,使用 npm 安装时可能会受限于官方源的下载速度过慢的问题。 在命令 npm install -g cnpm --registry=https://registry.npm.taobao.org 中,-g 参数表示全局安装 cnpm,即该工具将被安装为系统的全局命令。--registry=https://registry.npm.taobao.org 则指定了 cnpm 的安装源为淘宝的 npm 镜像源。 使用 cnpm,可以通过 cnpm install 命令来快速下载和安装 Node.js 包。相较于 npm,cnpm 提供了更高的下载速度,尤其适用于在中国访问速度较慢的情况下使用。安装 cnpm 后,我们可以在终端或命令提示符中使用 cnpm 来代替 npm 命令,从而享受到更好的下载速度。 总而言之,npm install -g cnpm --registry=https://registry.npm.taobao.org 命令的目的是为了在全局环境下安装 cnpm 工具,以便在中国地区快速下载和安装 Node.js 包。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值