nrm icon indicating copy to clipboard operation
nrm copied to clipboard

[email protected] cannot work in node-14.15 (win10)

Open varlinor opened this issue 3 years ago • 7 comments

when I upgrade node from v12.x to v14.15 in windows10,after install nrm to global, the command throws error! just like below:

c:\>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> (D:\develop\node-v14.15.4-win-x64\node_global\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'
} 

after few times to try, finally, #79 give us the right way to fix it

so if you want your [email protected] work rightly, you can rewrite the code at row 17th in your node_global/node_modules/nrm/cli.js ;

const NRMRC = path.join(process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'], '.nrmrc');

use USERPROFILE to replace HOME in win32 platform can fix local using temporarily.

At last ,Sincerely hope maintainer @Pana or @EmilyMew can merge pr #80 with to fix this bug!

varlinor avatar Feb 04 '21 03:02 varlinor

After I uninstalled 14.15.4 and reinstalled 12.20.1,I also have this bug.

FQLin avatar Feb 04 '21 11:02 FQLin

I also have this bug, win10, node version 14.15.4

rong17173 avatar Feb 05 '21 02:02 rong17173

目前,只能先这样用着先(等到后期官方发包再改: npm i https://github.com/stefango/nrm.git#patch-1 -g

xiaofan9 avatar Feb 08 '21 05:02 xiaofan9

same issue

tyanbiao avatar Feb 19 '21 06:02 tyanbiao

I checked the source code, and find out you need add a environment variable call HOME, then, problem can be solved, i am not good at english, hope you can get it :)

Y334275 avatar Mar 06 '21 15:03 Y334275

I checked the source code, and find out you need add a environment variable call HOME, then, problem can be solved, i am not good at english, hope you can get it :)

what is the value of the HOME env?

FQLin avatar Mar 13 '21 15:03 FQLin

I checked the source code, and find out you need add a environment variable call HOME, then, problem can be solved, i am not good at english, hope you can get it :)

what is the value of the HOME env?

Node installation directory

Y334275 avatar Mar 14 '21 11:03 Y334275