Closed aviralgoyal closed 2 years ago
I can reproduce the same issue, myService can be installed successfully, but can't start, if you start from Service explorer, getting error
Windows could not start the service on local computer
Error:1067 : The process terminated unexpectedly.
and I run myService from daemon folder directly, I am getting error below:
Cannot start service from the command line or debugger. A winwows Service must first be
installed(using installutil.exe) and then started with the ServerExplorer, Windows Services
Administrative tool or the NET START command.
the change I recently made on my Windows 10 is the Win10 got IT updated to version 20H2 so my OS is now
Edition: Windows 10 Enterprise
Version: 20H2
OS build: 19042.1645
Node JS: v16.13.1
also the myService was able to restarted before OS upgrade, after OS upgrade I can no longer start myService anymore.
here is myService.err from daemon/
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module '@author.io/args'
Require stack:
- C:\Users\echoleyo\AppData\Roaming\npm\node_modules\node-windows\lib\wrapper.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Users\echoleyo\AppData\Roaming\npm\node_modules\node-windows\lib\wrapper.js:3:12)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\echoleyo\\AppData\\Roaming\\npm\\node_modules\\node-windows\\lib\\wrapper.js'
]
}
I found the similar issue from another thread, the difference is that all my services are still there after OS upgrade, and it shows running, but it actually not functional correctly, then I tried to restart my service, it can no longer restart anymore, seems like there are some restriction on install and run the service? https://github.com/coreybutler/node-windows/issues/231#issuecomment-880982025
Same problem here. Any solutions?
I'm getting the same issue. I had it running and then made some changes to my node server, restarted the service and it no longer runs now. I see the same errors in my err.log file.
For those coming here stuck, there is a workaround in the other thread about this here: https://github.com/coreybutler/node-windows/issues/308 Basically downgrade to 1.0.0-beta.6
Same problem, Error 1067 after 1.0.0-beta7 upgrade. Windows 10. Node 18.3.0. If I uninstall service, it prompts a windows window to install a windows .net framework 2.5 or 3.0 or something like that.
I have downgraded to 1.0.0-beta6 and it works well, as before.
Thanks @nassau-t! Here the same issue, we downgraded and everything went well...waiting for news about this issue
1.0.0-beta8 - Error 1067 repeated again 1.0.0-beta6 - Works good
UPD: Removed node-windows via npm + removed the node_modules and .package folder in the project. Installed on the new node-windows and everything worked, thanks to the author for the work!
Several issues have been brought up. I'll try to address them.
First, version 1.0.0-beta.7 had a dependency that only worked with ESM. This was resolved in 1.0.0-beta.8. The only difference between v1.0.0-beta.6 and v1.0.0-beta.8 is that the vulnerable optimist dependency was replaced with the yargs module.
When processes launch but terminate early, it means node-windows successfully installed the service and started it, but it ended abruptly. 99% of the time, this is due to the script or something happening on the operating system. When upgrading Windows, the most common root causes are permissions. Make sure the user account running the service still has permissions to do what it needs to do, specifically with folder read/write permissions. Another common problem with upgrading Windows are the updates to Defender, which will sometimes block ports that were previously open. In Windows 11, some people enable Protected Folders, which may block the node-windows executable from running, as shown in the screenshot below:
When re-installing/upgrading node-windows, those who use a version manager need to remember node-windows needs to be reinstalled for each version.
When upgrading node-windows, you may need to reinstall your services in order to bundle the latest code. The XML manifest that's bundled in the output of each installation provides paths to the node-windows wrapper.js file. That's the file that uses yargs instead of optimist now. Existing services need to point to the appropriate wrapper.js file. Most users will not have to do anything to make this work if node-windows is installed in the same location it was before. However; any running services will need to be restarted to use the new wrapper.js file.
I'm closing this because I do not think most of these issues are node-windows related, except for those related to v1.0.0-beta.7, which is now deprecated in favor of v1.0.0-beta.8. Please open a new issue if you are still having trouble with terminated processes.
Issue: NodeJs Application running successfully as service on most systems, but on some systems the service fails to start with the following error:
On checking Windows Logs following:
nodejs v14 Windows 10
I am unable to debug the issue as the same service is running fine on one system and not on another. Don't know how to debug or reproduce the error.
Is there a way to debug the issue? Or is this a known issue?