You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Command failed: Registry editing has been disabled by your administrator. #56
I am having lots of errors on Windows (App not loading properly) and after some digging, the error happens to be from this library that relies on running regedit in the background.
C:\Users\j\machineId> node index.js
Error: Error while obtaining machine id: Error: Command failed: %windir%\System32\REG.exe QUERY HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography /v MachineGuid
ERROR: Registry editing has been disabled by your administrator.
at ChildProcess.exithandler (child_process.js:308:12)
at ChildProcess.emit (events.js:314:20)
at maybeClose (internal/child_process.js:1021:16)
at Socket.<anonymous> (internal/child_process.js:443:11)
at Socket.emit (events.js:314:20)
at Pipe.<anonymous> (net.js:676:12)
at C:\Users\j\machineId\node_modules\node-machine-id\dist\index.js:1:7964
at ChildProcess.exithandler (child_process.js:315:5)
at ChildProcess.emit (events.js:314:20)
at maybeClose (internal/child_process.js:1021:16)
at Socket.<anonymous> (internal/child_process.js:443:11)
at Socket.emit (events.js:314:20)
at Pipe.<anonymous> (net.js:676:12)
The error hints that this user does not have admin privileges to run regedit, thus is unable to obtain the unique machine ID. Is there a way of resolving this issue?
Hello, is there an update on this? I thought that this library does not need elevated rights for the Machine IDs (GUID) but found out that this library silently needs elevated access to regedit.
But from my tests it needs elevated access so it is a bit misleading here, potential usecase of this failing is getting the Machine IDs of work computers.
Error: CC(target) Release/obj.target/nothing/../node-addon-api/nothing.o
LIBTOOL-STATIC Release/nothing.a
warning: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: archive library: Release/nothing.a the table of contents is empty (no object file members in the library define global symbols)
CXX(target) Release/obj.target/reg/reg.o
In file included from ../reg.cc:1:
/Users/caylan/local-dev/label-live/app/LabelLIVE-App/app/node_modules/node-addon-api/napi.h:32:6: error: Exception support not detected. Define either NAPI_CPP_EXCEPTIONS or NAPI_DISABLE_CPP_EXCEPTIONS.
#error Exception support not detected. \
^
../reg.cc:4:10: fatal error: 'windows.h' file not found
#include <windows.h>
^~~~~~~~~~~
2 errors generated.
@Nokel81, I had a windows user test my app's build with your PR and it worked. So that's good news!
I'm not in a good position to modify this codebase, but if you want to take a stab at a solution (dynamic import) I'm happy to test it across macOS and Windows.
I have troubles with the package node-machine-id, also. The package node-module-id uses REG.exe for windows, which has been blocked by our administrators. It would be nice, when nx.dev wouldn't use this package and find another solution the generate a unique machine id. (https://www.npmjs.com/package/uuid -> store id somewhere?)
We need a chance to use nx.dev in our company without changing the administrative permissions / group policies.
Another thought: Give us the possibility to store the machine id as environment file?
.env
MACHINE_ID=some_incredible_id
DanielMichelfelderAtFoerch commented on Apr 10, 2025
You have the option to use inital cloud functionality or the local one. In case you don't use the advantages of sharing the cache in the cloud, the generation of the machineId is not neccessary.
Activity
pateljoel commentedon Jun 9, 2021
Hello, is there an update on this? I thought that this library does not need elevated rights for the Machine IDs (GUID) but found out that this library silently needs elevated access to
regedit.And from the features page:
But from my tests it needs elevated access so it is a bit misleading here, potential usecase of this failing is getting the Machine IDs of work computers.
Is there a workaround for this?
Thanks.
Nokel81 commentedon Jul 7, 2021
@pateljoel I have submitted a PR to fix this issue (though it might be a bit big).
semireg commentedon Jul 23, 2021
@Nokel81, I am in the process of testing your patch on Windows, but heads up that your work breaks builds on macOS. Here's what I'm seeing:
and... if I try to satisfy that dependency:
Nokel81 commentedon Jul 23, 2021
Ah I am sorry about that, maybe a dynamic import for only windows would be better?
semireg commentedon Jul 23, 2021
@Nokel81, I had a windows user test my app's build with your PR and it worked. So that's good news!
I'm not in a good position to modify this codebase, but if you want to take a stab at a solution (dynamic import) I'm happy to test it across macOS and Windows.
Nokel81 commentedon Sep 13, 2021
Will do
Nokel81 commentedon Sep 13, 2021
@semireg done
semireg commentedon Sep 14, 2021
@Nokel81, did you see the latest comment over at native-reg? He's modified the gypfile to minimize complexity with bundling/packaging.
simonbuchan/native-reg#23 (comment)
DanielMichelfelderAtFoerch commentedon Apr 10, 2025
I have troubles with the package
node-machine-id, also. The packagenode-module-idusesREG.exefor windows, which has been blocked by our administrators. It would be nice, when nx.dev wouldn't use this package and find another solution the generate a unique machine id. (https://www.npmjs.com/package/uuid -> store id somewhere?)We need a chance to use nx.dev in our company without changing the administrative permissions / group policies.
Another thought: Give us the possibility to store the machine id as environment file?
.env
DanielMichelfelderAtFoerch commentedon Apr 10, 2025
Just for all the seeking users out there:
You have the option to use inital cloud functionality or the local one. In case you don't use the advantages of sharing the cache in the cloud, the generation of the machineId is not neccessary.
I added the following code to my nx.json:
... that let me execute the nx serve - command.