Comments (3)
I fixed by manually specifying a longer wait time, the default 2 seconds don't seem to be long enough (between uninstalling the service and deleting the daemon file).
svc.uninstall(5);
from node-windows.
I'm seeing the same issue on Windows 10. Any updates or insight on what's causing it?
from node-windows.
- Error is displayed, service is not deleted
In my case, I'd say the service is deleted from Windows services.msc, but node-windows fails to delete mydaemon.wrapper.log
because it's not permitted to do it. It's clearly not a wait time issue in my case:
Error: EPERM: operation not permitted, unlink 'C:\mydaemon\daemon\ftlnodeagent.wrapper.log'
at Object.unlinkSync (node:fs:1767:3)
at rm (C:\Users\myuser\AppData\Roaming\npm\node_modules\node-windows\lib\daemon.js:602:22)
at C:\Users\threedeeverse\AppData\Roaming\npm\node_modules\node-windows\lib\daemon.js:610:15
at ChildProcess.exithandler (node:child_process:394:7)
at ChildProcess.emit (node:events:513:28)
at maybeClose (node:internal/child_process:1100:16)
at Socket.<anonymous> (node:internal/child_process:458:11)
at Socket.emit (node:events:513:28)
at Pipe.<anonymous> (node:net:301:12) {
errno: -4048,
syscall: 'unlink',
code: 'EPERM',
path: 'C:\\mydaemon\\daemon\\ftlnodeagent.wrapper.log'
This does happen on a VM (Windows Server 2019) but does not happen on my workstation (Windows 10). Both installs the service with logOnAs
with the main administrator user from a regular command line (non elevated).
Strangely on the VM, if the svc.uninstall()
is run from a regular command line, then it's not permitted to delete ftlnodeagent.wrapper.log
. But if it's run from an administrator command line then it succeeds to delete ftlnodeagent.wrapper.log
.
If I review the security tab of the log file properties then the "group or user names" and premissions are clearly different on the Windows Server 2019 VM.
Workaround:
Pre-create the .wrapper.log
.out.log
.err.log
from my installation script before calling svc.install()
. So the user who installs the service has permissions to delete those file when calling svc.uninstall()
.
from node-windows.
Related Issues (20)
- [11/11/22]: [Register with windows restart manager] HOT 1
- 12/23/2022: Setting service.install() verbosity HOT 1
- Pipe Stream Connection
- having windows authentication issue with Sequalize library HOT 4
- Execute npm start HOT 5
- 07/02/2023: Dependent on another service HOT 5
- Problem running git HOT 3
- My service is stopped but the program is still running HOT 1
- Service install silently fails on Windows 11 HOT 4
- Service created BUT NOT RUNNING HOT 5
- Needs windows restart before creating service HOT 1
- 03/30/2023: Please release a non-beta version HOT 2
- node-windows with babel and pkg HOT 1
- Question: Is it possible to split .exe creation and service creation HOT 1
- Comments in the XML file break the service executable
- Unsupported node: v19.0.0 HOT 1
- Event Logging other than event id 1000 HOT 7
- File path HOT 2
- 2023-07-13: React functionality HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-windows.