Closed
Description
在最新版,1.2.5 依然没有解决这个问题??
从旧版本看 .nrmrc 文件中只会保存一条记录。
在1.2.5 中 cli.js 文件的 211 行, 判断逻辑是有问题的。hasOwnProperty 判断不应从 customRegistries中是否存在用户输入的name变量传递的值。[如:npm、taobao] ,判断应该从所有allRegistries 的集合中判断是否存在输入 use 后面的值。
`
if (hasOwnProperty(allRegistries, name) && (name in registries || customRegistries[name].registry === registry.registry)) {
//if (!hasOwnProperty(customRegistries, name) && (name in registries || customRegistries[name].registry === registry.registry)) {
registry[FIELD_IS_CURRENT] = true;
customRegistries[name] = registry;
}
`
希望作者处理一下该问题!
Activity
lpreterite commentedon Nov 19, 2021
遇到相同情况,从1.2.1版本更新至1.2.5后就没法识别当前的registry。能确认的是在版本1.2.1是正常的。
lisongtao0704 commentedon Nov 28, 2021
遇到相同情况,还有我在mac M1芯片的上面安装1.2.1也不行呀
adams549659584 commentedon Nov 30, 2021
npm上新版的代码似乎是8年前的源码,是不是发布版本出现了问题? @i5ting
adams549659584 commentedon Nov 30, 2021
这是npm下载的最新的包,但是不带星及当前的,看了下源码应该是8年前的
adams549659584 commentedon Dec 1, 2021
有需要的同学可以先用这个(npm install -g @adams549659584/nrm),github action 自动发布最新到npm,使用命令一致,星号正常
shalldie commentedon Dec 17, 2021
也遇到了,希望能够早点解决,看着挺揪心了 =。=
lpreterite commentedon Dec 17, 2021
这位同学PR一下更好
adams549659584 commentedon Dec 17, 2021
主要是代码没问题的,只是可能打包到npm的版本出问题了,搞个合并PR时自动打包好像也不大好
Minori-ty commentedon Jan 6, 2022
同样的问题,本来还想提个issue呢
Minori-ty commentedon Jan 6, 2022
我这里依旧是不行阿。win10
Minori-ty commentedon Jan 6, 2022
应该是缓存的问题,我到C:\Users\15638\AppData\Roaming\npm\node_modules 里面关于nrm的包全都删了,并且把npm_cache缓存的文件也删了。

然后就好了。
adams549659584 commentedon Jan 6, 2022
嗯嗯,一般卸载原来的再装下这个就好
rawbin- commentedon Jan 19, 2022
发现现在直接安装源码是ok的
uwang commentedon Feb 8, 2022
这个包的发布有问题,暂时还是直接安装源码吧
终端不好用代理,可以直接用国内镜像仓库
515789588 commentedon Mar 10, 2022
nrm use 原始的几个源不带*号,并且切换好像不生效,
新增的源就可以,所以想用哪个源,可以暂时把他搞个别名来用
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/
31npm -------- http://package.31huiyi.com/repository/npm-group/
liurongqing commentedon Apr 17, 2022
暂时 github 仓库直接安装
cll123456 commentedon Aug 30, 2022
@liurongqing 非常感谢,这种方式是ok的
codepandy commentedon Oct 20, 2022
上面说的直接源安装失败,@liurongqing说的亲测有效
yuxixi0613 commentedon Oct 26, 2022
Good Job!!!
weijuer commentedon Jan 3, 2023
Good Job!!!