Pana / nrm

NPM registry manager, fast switch between different registries: npm, cnpm, nj, taobao
MIT License
2.79k stars 244 forks source link

nrm ls 依然不带星或nrm current 不显示当前? #111

Open fch89 opened 2 years ago

fch89 commented 2 years ago

在最新版,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;

}

`

希望作者处理一下该问题!

lpreterite commented 2 years ago

遇到相同情况,从1.2.1版本更新至1.2.5后就没法识别当前的registry。能确认的是在版本1.2.1是正常的。

lisongtao0704 commented 2 years ago

遇到相同情况,还有我在mac M1芯片的上面安装1.2.1也不行呀

adams549659584 commented 2 years ago

npm上新版的代码似乎是8年前的源码,是不是发布版本出现了问题? @i5ting

adams549659584 commented 2 years ago

image image 这是npm下载的最新的包,但是不带星及当前的,看了下源码应该是8年前的

adams549659584 commented 2 years ago

有需要的同学可以先用这个(npm install -g @adams549659584/nrm),github action 自动发布最新到npm,使用命令一致,星号正常

image

shalldie commented 2 years ago

也遇到了,希望能够早点解决,看着挺揪心了 =。=

lpreterite commented 2 years ago

有需要的同学可以先用这个(npm install -g @adams549659584/nrm),github action 自动发布最新到npm,使用命令一致,星号正常

image

这位同学PR一下更好

adams549659584 commented 2 years ago

有需要的同学可以先用这个(npm install -g @adams549659584/nrm),github action 自动发布最新到npm,使用命令一致,星号正常 image

这位同学PR一下更好

主要是代码没问题的,只是可能打包到npm的版本出问题了,搞个合并PR时自动打包好像也不大好

Minori-ty commented 2 years ago

同样的问题,本来还想提个issue呢

Minori-ty commented 2 years ago

有需要的同学可以先用这个(npm install -g @adams549659584/nrm),github action 自动发布最新到npm,使用命令一致,星号正常 image

这位同学PR一下更好

我这里依旧是不行阿。win10

Minori-ty commented 2 years ago

有需要的同学可以先用这个(npm install -g @adams549659584/nrm),github action 自动发布最新到npm,使用命令一致,星号正常 image

这位同学PR一下更好

我这里依旧是不行阿。win10

应该是缓存的问题,我到C:\Users\15638\AppData\Roaming\npm\node_modules 里面关于nrm的包全都删了,并且把npm_cache缓存的文件也删了。 然后就好了。 image

adams549659584 commented 2 years ago

有需要的同学可以先用这个(npm install -g @adams549659584/nrm),github action 自动发布最新到npm,使用命令一致,星号正常 image

这位同学PR一下更好

我这里依旧是不行阿。win10

应该是缓存的问题,我到C:\Users\15638\AppData\Roaming\npm\node_modules 里面关于nrm的包全都删了,并且把npm_cache缓存的文件也删了。 然后就好了。 image

嗯嗯,一般卸载原来的再装下这个就好

rawbin- commented 2 years ago

发现现在直接安装源码是ok的

npm install Pana/nrm -g
uwang commented 2 years ago

这个包的发布有问题,暂时还是直接安装源码吧 终端不好用代理,可以直接用国内镜像仓库

git clone https://gitee.com/gh-cn/nrm.git
cd nrm && yarn
cd ..
npm install -g ./nrm
515789588 commented 2 years ago

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/

ghost commented 2 years ago

Snipaste output Modify 211 lines of code in cli.js,The problem can be solved by changing && to | |.

liurongqing commented 2 years ago

暂时 github 仓库直接安装

npm i -g git+https://github.com/Pana/nrm.git

31650209933_ pic

cll123456 commented 2 years ago

@liurongqing 非常感谢,这种方式是ok的

codepandy commented 1 year ago

上面说的直接源安装失败,@liurongqing说的亲测有效

yuxixi0613 commented 1 year ago

Snipaste output Modify 211 lines of code in cli.js,The problem can be solved by changing && to | |.

Good Job!!!

weijuer commented 1 year ago

Good Job!!!