Closed kam1kaze911 closed 8 months ago
i cannot reproduce your problem. i tried both installing and upgrading with npm on my windows11, and found no problem. the error you see is from npm, not hfs.
i also tried the instructions in the readme to make it as a service, and it worked. i noticed Windows instructions use npm instead of npx, i'd like to change that, for easier upgrading.
if you cannot solve with npm, consider running hfs-windows.zip
Sadly I couldn't manage to get it working again via npm. Perhaps someone comes across this type of error, maybe I will post this to npm discussions. Seems like sth npm and git problem to me.
Got HFS now running using hfs-windows.zip installed as a service with "NSSM - the Non-Sucking Service Manager".
Only thing I am wondering, will the .exe always will be named "new-hfs.exe (after update, originally hfs.exe)? This would be crucial to ensure a working service.
during the update process, the file is named "new", but then renamed to "hfs.exe". It is possible that autoamtic update process is not compatible with services, i'm not sure about it. I'm willing to accept suggestions on these matters.
for your npm/git problem, i'd like to see more console output of the installation process, and what command are you using.
Not to hijack, just to comment and share... I have been using "NSSM - the Non-Sucking Service Manager" to run HFS as a service, and when upgrading HFS version the process in HFS does not complete : not being able to force rename new-hfs.exe to hfs.exe because NSSM has the hfs.exe opened/blocked (I can see the message in debug.log). Never found a workaround to it (tried messing with hfs-updater plugin but with no success). Right now I have to manually stop the service - rename to hfs.exe - start the service. Not so critical in my case hopefully.
If @rejetto or anyone reading has a good suggestion how to fully automate upgrades with HFS as a service on Windows, I'd really appreciate ;-)
i'm not expert with services. Making the update work with the executables across windows+mac+linux (without involving services) was a nightmare that took me a week of exhausting trial-and-error.
Maybe it is possible to add service management, like hfs stopping its own service and starting it again after the update, but this may require more days of work (on Windows, that's not even my system). It would be nice to get some help on this. For the moment I'm not tackling this.
One thing that I'm adding right now is to NOT allow automatic update if you are running as service.
YOu can see that on Linux I suggested to run as a service "npx -y hfs@latest", so that to update you just need to restart the service (or I hope so, i didn't try myself).
"Maybe it is possible to add service management, like hfs stopping its own service and starting it again after the update, but this may require more days of work (on Windows, that's not even my system). It would be nice to get some help on this. For the moment I'm not tackling this."
Fully agreed, this is not critical at all !
When I have time I might try more tests based on "hfs-updater" HFS plugin but so far I blocked on how to stop/restart the service, without killing the plugin itself before it can even rename the exe... ;). A solution could be a separate "updater service" polling the new-hfs.exe presence and with the appropriate rights managing the stop/rename/start sequence...
Solved the npm problem! I needed to install git so npm is able to find git.
winget install --id Git.Git -e --source winget
Thought about the two ways running HFS hidden: Good thing about running HFS in npm environment is, that it's a service and managed by npm. Downside is, you need to create a task for updating with the commands from the readme.md.
Good thing about running HFS from zip is, you can update via Admin-panel which is convenient and the intended way to update. Downside is, it does not run hidden (service).
Currently I am experimenting with zip version and service configuration. The problem @rockrider69 describes needs to be solved - we will work sth out eventually :)
If this does not work, then the commands
net stop <nameofservice>
and net start <nameofservice>
could solve the issue the updater could not rename the binary to 'hfs.exe'. Service name 'HFS' of course.
Thanks for the support and the discussion!
Good thing about running HFS in npm environment is, that it's a service and managed by npm. Downside is, you need to create a task for updating with the commands from the readme.md.
what task?
if you run it with npx -y hfs@latest
as in my previous message, it should update just by restarting the service
I am having the same issue as the issue creator, but only when try to install with the --proxy
parameter.
i've managed to solve this problem, so now you can npx -y hfs@latest
I am having a problem since hfs v50.1 that it will not update via npm. console returns this error (npm log):
now i tried to clean up everything including npm, node.js and every other npm package but no success. installing other packages (e.g., node-red) works fine. Also tried npx instead of npm but returns the same error.
how can i solve this issue? am I missing an environmental part?