工具 nrm ls 不带星,并且 nrm current 没有任何输出

原文:https://makeoptim.com/tool/nrm-ls-no-star

问题现象

执行以下命令,安装最新版 nrm

1
$ npm i -g nrm

执行以下命令

1
2
3
4
5
6
7
8
$ nrm ls

npm ---------- https://registry.npmjs.org/
yarn --------- https://registry.yarnpkg.com/
tencent ------ https://mirrors.cloud.tencent.com/npm/
cnpm --------- https://r.cnpmjs.org/
taobao ------- https://registry.npmmirror.com/
npmMirror ---- https://skimdb.npmjs.com/registry/

没有看到星(*)标注当前的 registry

执行以下命令

1
$ nrm current

没有任何输出

解决方法

执行以下命令,通过源码安装 nrm

1
$ npm install Pana/nrm -g

验证

1
2
3
4
5
6
7
8
9
10
$ nrm ls
* npm ---------- https://registry.npmjs.org/
yarn --------- https://registry.yarnpkg.com/
tencent ------ https://mirrors.cloud.tencent.com/npm/
cnpm --------- https://r.cnpmjs.org/
taobao ------- https://registry.npmmirror.com/
npmMirror ---- https://skimdb.npmjs.com/registry/

$ nrm current
You are using npm registry.

参考链接