Pana / nrm

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

nrm ls internal/validators.js:124 throw new ERR_INVALID_ARG_TYPE(name, 'string', value); #94

Closed happy-func closed 3 years ago

happy-func commented 3 years ago

plateform win10 node 14.15.1

nrm ls
internal/validators.js:124
    throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
[TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
  at validateString (internal/validators.js:124:11)
  at Object.join (path.js:375:7)
  at Object.<anonymous> (C:\Users\zzx\AppData\Roaming\npm\node_modules\nrm\cli.js:17:20)
  at Module._compile (internal/modules/cjs/loader.js:1063:30)
  at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
  at Module.load (internal/modules/cjs/loader.js:928:32)
  at Function.Module._load (internal/modules/cjs/loader.js:769:14)
  at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
  at internal/main/run_main_module.js:17:47
] {
  code: 'ERR_INVALID_ARG_TYPE'
}
Wangggym commented 3 years ago

I had the same problem image

happy-func commented 3 years ago

平台win10

节点14.15.1

最低价
内部/validators.js:124
    throw new ERR_INVALID_ARG_TYPE(name, ' string ' , value) ; 
[TypeError [ERR_INVALID_ARG_TYPE]:“路径”参数必须是字符串类型。收到未定义
  在validateString (internal/validators.js:124:11)
  在 Object.join (path.js:375:7)
  在对象。<匿名>(C:\用户\Ž ZX \ A ppData \漫游\ n时\ n ode_modules \ n RM \ C li.js:17:20)
  在 Module._compile (internal/modules/cjs/loader.js:1063:30)
  在 Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
  在 Module.load (internal/modules/cjs/loader.js:928:32)
  在 Function.Module._load (internal/modules/cjs/loader.js:769:14)
  在 Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
  在内部/main/run_main_module.js:17:47
] {
  代码:' ERR_INVALID_ARG_TYPE '
}

可以试一下在 我的电脑->环境变量 中设置一个HOME的系统变量,指向.nrmrc文件这一层,默认是 C:\Users\xxxx,看了他的源码 应该是读取process.env.HOME的时候没获取到这个环境变量。

image

image

好的,回头搞一下看看

Benleie commented 3 years ago

https://www.npmjs.com/package/correct-nrm

你好坏啊,改了一行代码都要发个npm包。。

hhaoao commented 3 years ago

作者不更新,怪不得人家开新包呀.