Skip to content

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

Closed
@fch89

Description

@fch89

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

lpreterite commented on Nov 19, 2021

@lpreterite

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

lisongtao0704

lisongtao0704 commented on Nov 28, 2021

@lisongtao0704

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

adams549659584

adams549659584 commented on Nov 30, 2021

@adams549659584

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

adams549659584

adams549659584 commented on Nov 30, 2021

@adams549659584

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

adams549659584

adams549659584 commented on Dec 1, 2021

@adams549659584

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

image

shalldie

shalldie commented on Dec 17, 2021

@shalldie

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

lpreterite

lpreterite commented on Dec 17, 2021

@lpreterite

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

image

这位同学PR一下更好

adams549659584

adams549659584 commented on Dec 17, 2021

@adams549659584

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

这位同学PR一下更好

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

Minori-ty

Minori-ty commented on Jan 6, 2022

@Minori-ty

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

Minori-ty

Minori-ty commented on Jan 6, 2022

@Minori-ty

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

这位同学PR一下更好

我这里依旧是不行阿。win10

Minori-ty

Minori-ty commented on Jan 6, 2022

@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

adams549659584 commented on Jan 6, 2022

@adams549659584

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

这位同学PR一下更好

我这里依旧是不行阿。win10

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

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

rawbin-

rawbin- commented on Jan 19, 2022

@rawbin-

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

npm install Pana/nrm -g
uwang

uwang commented on Feb 8, 2022

@uwang

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

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

515789588 commented on Mar 10, 2022

@515789588

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
liurongqing

liurongqing commented on Apr 17, 2022

@liurongqing

暂时 github 仓库直接安装

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

31650209933_ pic

cll123456

cll123456 commented on Aug 30, 2022

@cll123456

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

codepandy

codepandy commented on Oct 20, 2022

@codepandy

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

yuxixi0613

yuxixi0613 commented on Oct 26, 2022

@yuxixi0613

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

Good Job!!!

weijuer

weijuer commented on Jan 3, 2023

@weijuer

Good Job!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @lpreterite@rawbin-@uwang@shalldie@adams549659584

        Issue actions

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