nrm 报[TypeError [ERR_INVALID_ARG

2021-03-15  本文已影响0人  亦亦嘟嘟
internal/validators.js:120
    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:120:11)
  at Object.join (path.js:375:7)
  at Object.<anonymous> (C:\Users\Administrator\AppData\Roaming\npm\node_modules\nrm\cli.js:17:20)
  at Module._compile (internal/modules/cjs/loader.js:1015:30)

打开C:\Users\Administrator\AppData\Roaming\npm\node_modules\nrm\cli.js:17:20)

// const NRMRC = path.join(process.env.HOME, '.nrmrc');
改成下面这样既可
const NRMRC = path.join(process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'], '.nrmrc');
上一篇 下一篇

猜你喜欢

热点阅读