nrm icon indicating copy to clipboard operation
nrm copied to clipboard

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

Open fch89 opened this issue 3 years ago • 21 comments

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

}

`

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

fch89 avatar Nov 02 '21 16:11 fch89

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

lpreterite avatar Nov 19 '21 07:11 lpreterite

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

lisongtao0704 avatar Nov 28 '21 10:11 lisongtao0704

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

adams549659584 avatar Nov 30 '21 09:11 adams549659584

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

adams549659584 avatar Nov 30 '21 09:11 adams549659584

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

image

adams549659584 avatar Dec 01 '21 06:12 adams549659584

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

shalldie avatar Dec 17 '21 04:12 shalldie

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

image

这位同学PR一下更好

lpreterite avatar Dec 17 '21 05:12 lpreterite

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

这位同学PR一下更好

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

adams549659584 avatar Dec 17 '21 05:12 adams549659584

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

Minori-ty avatar Jan 06 '22 11:01 Minori-ty

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

这位同学PR一下更好

我这里依旧是不行阿。win10

Minori-ty avatar Jan 06 '22 11:01 Minori-ty

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

这位同学PR一下更好

我这里依旧是不行阿。win10

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

Minori-ty avatar Jan 06 '22 11:01 Minori-ty

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

这位同学PR一下更好

我这里依旧是不行阿。win10

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

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

adams549659584 avatar Jan 06 '22 11:01 adams549659584

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

npm install Pana/nrm -g

rawbin- avatar Jan 19 '22 08:01 rawbin-

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

git clone https://gitee.com/gh-cn/nrm.git
cd nrm && yarn
cd ..
npm install -g ./nrm

uwang avatar Feb 08 '22 03:02 uwang

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/

  • cyarn -------- https://registry.yarnpkg.com/

515789588 avatar Mar 10 '22 09:03 515789588

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

ghost avatar Mar 11 '22 02:03 ghost

暂时 github 仓库直接安装

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

31650209933_ pic

liurongqing avatar Apr 17 '22 15:04 liurongqing

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

cll123456 avatar Aug 30 '22 02:08 cll123456

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

codepandy avatar Oct 20 '22 03:10 codepandy

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

Good Job!!!

yuxixi0613 avatar Oct 26 '22 07:10 yuxixi0613

Good Job!!!

weijuer avatar Jan 03 '23 06:01 weijuer