how to fix A system error occurred: uv_os_gethostname returned ENOSYS in node installing vue cli
I am using windows 7 as well and installed npm 9.2.0 and nodev16.16.0 now when I try to install vue cli and try to check version of the vue cli it is uncounted following error message
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Mara>vue v
node:os:68
throw new ERR_SYSTEM_ERROR(ctx);
^
SystemError [ERR_SYSTEM_ERROR]: A system error occurred: uv_os_gethostname retur
ned ENOSYS (function not implemented)
at new Defaults (C:\node32\node_modules\@vue\cli\node_modules\@achrinza\node
-ipc\entities\Defaults.js:26:20)
at new Parser (C:\node32\node_modules\@vue\cli\node_modules\@achrinza\node-i
pc\entities\EventParser.js:8:14)
at Object.<anonymous> (C:\node32\node_modules\@vue\cli\node_modules\@achrinz
a\node-ipc\dao\client.js:11:19)
at Module._compile (node:internal/modules/cjs/loader:1105:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\node32\node_modules\@vue\cli\node_modules\@achrinz
a\node-ipc\services\IPC.js:4:14) {
code: 'ERR_SYSTEM_ERROR',
info: {
errno: -4054,
code: 'ENOSYS',
message: 'function not implemented',
syscall: 'uv_os_gethostname'
},
errno: [Getter/Setter],
syscall: [Getter/Setter]
}
C:\Users\Mara>
This error occurs because the uv_os_gethostname function is not implemented in the Node.js version you are using. To fix this, you can try upgrading your Node.js version to the latest stable version or downgrade to a lower version that supports this function.
If upgrading or downgrading Node.js is not an option, you can try the following workaround:
Open the command prompt as an administrator.
Run the following command to set the environment variable:
setx UV_THREADPOOL_SIZE 128
Restart your computer.
Try installing Vue CLI again.
This should fix the issue. If you still face any issues, try running the command prompt as an administrator and then run the above command.
Note: The above workaround may not work for all cases. It is recommended to upgrade or downgrade Node.js to a version that supports the uv_os_gethostname function.