Hi, when I install a new site, I get a Windows notification message in the bottom right corner that says “Local is requesting administrative privileges to modify your /etc/hosts file”. However, the UAC dialog box never appears. And then I see this in the log file:
{"thread":"main","class":"HostsFileService","level":"info","message":"Updating hosts with","timestamp":"2020-05-08T21:02:26.085Z"}
{"thread":"main","class":"HostsFileService","error":{"message":"User did not grant permission.","stack":"Error: User did not grant permission.\n at G:\\Program Files\\Local\\resources\\app.asar\\node_modules\\sudo-prompt\\index.js:534:29\n at ChildProcess.exithandler (child_process.js:315:5)\n at ChildProcess.emit (events.js:203:13)\n at maybeClose (internal/child_process.js:1021:16)\n at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)"},"level":"error","message":"Could not update hosts.","timestamp":"2020-05-08T21:02:26.962Z"}
A similar thing happens when I try to set up a SSL certificate. After clicking on “TRUST”, a notification appears in the bottom right hand corner saying “local is requesting administrative privileges to trust a certificate” but again, the UAC prompt never appears. And this is recorded in the log file:
{"thread":"main","reason":{"error":{}},"p":{},"level":"warn","message":"Unhandled Rejection.","timestamp":"2020-05-09T03:15:00.532Z"}
It seems that for some reason, the call to sudo-prompt is failing. I have found a number of similar posts on here and have followed all the proposed solutions:
- make sure read flag is not set on the hosts file
- check if there is anti-virus that may be locking the file
- disable firewalls
- run Local in administrative mode
I have also tried clean installing different versions of Local(5.2.8, 5.3.3, 5.4.1, 5.4.2), installing different versions of nodejs and restarting the computer to clear any lingering processes but nothing seems to work.
I’m not sure what else to try so I was wondering if anyone else has found a solution? Any help would be greatly appreciated. Thanks.