After installing NPM, NRM LS reports an error throw new err_INVALID_ARG_TYPE(name, ‘string‘, value)

Error screenshot:

error screenshots are seen in the cli. Js file line 17 error,

According to the path to find the file:
open files found an error line 17, note down the original 17 rows instead as shown in figure:

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

After executing CMD, enter NRM ls problem solved

Read More: