Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nrm@1.2.1 cannot work in node-14.15 (win10) #81

Open
varlinor opened this issue Feb 4, 2021 · 7 comments
Open

nrm@1.2.1 cannot work in node-14.15 (win10) #81

varlinor opened this issue Feb 4, 2021 · 7 comments

Comments

@varlinor
Copy link

varlinor commented Feb 4, 2021

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 nrm@1.2.1 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!

@FQLin
Copy link

FQLin commented Feb 4, 2021

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

@rong17173
Copy link

I also have this bug, win10, node version 14.15.4

@xiaofan9
Copy link

xiaofan9 commented Feb 8, 2021

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

@tyanbiao
Copy link

same issue

@Y334275
Copy link

Y334275 commented Mar 6, 2021

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 :)

@FQLin
Copy link

FQLin commented Mar 13, 2021

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?

@Y334275
Copy link

Y334275 commented Mar 14, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants