rejetto / hfs

HFS is a web file server to run on your computer. Share folders or even a single file thanks to the virtual file system.
GNU General Public License v3.0
2.07k stars 202 forks source link

Node.js service crashes #690

Open DROZD-01 opened 1 month ago

DROZD-01 commented 1 month ago

Describe the bug Right after installation through node.js script provided in this github repo, when attempt to launch the created service - it immediately stops.

hfs.err.log in C:\Users\Admin\AppData\Roaming\npm\node_modules\hfs\src\daemon

node:internal/bootstrap/switches/does_own_process_state:130
  rawMethods.chdir(directory);
             ^

Error: ENOENT: no such file or directory, chdir 'C:\Users\Admin' -> '\Users\Admin\.hfs'
    at process.wrappedChdir [as chdir] (node:internal/bootstrap/switches/does_own_process_state:130:14)
    at Object.<anonymous> (C:\Users\Admin\AppData\Roaming\npm\node_modules\hfs\src\const.js:70:13)
    at Module._compile (node:internal/modules/cjs/loader:1358:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
    at Module.load (node:internal/modules/cjs/loader:1208:32)
    at Module._load (node:internal/modules/cjs/loader:1024:12)
    at Module.require (node:internal/modules/cjs/loader:1233:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (C:\Users\Admin\AppData\Roaming\npm\node_modules\hfs\src\sse.js:5:17)
    at Module._compile (node:internal/modules/cjs/loader:1358:14) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'chdir',
  path: 'C:\\Users\\Admin',
  dest: '\\Users\\Admin\\.hfs'
}

Node.js v20.15.1

Expected behavior Service launches and stays operational.

Environment OS: Windows Server 2019 1809 HFS Version 0.53.0 Browser: Chrome

praveenkumar-s commented 1 month ago

Error: ENOENT: no such file or directory, chdir 'C:\Praveen\hfs-main' -> '\Users\Administrator.hfs' at process.wrappedChdir [as chdir] (node:internal/bootstrap/switches/does_own_process_state:130:14) at Object. (C:\Users\Administrator\AppData\Roaming\npm\node_modules\hfs\src\const.js:70:13) at Module._compile (node:internal/modules/cjs/loader:1358:14) at Module._extensions..js (node:internal/modules/cjs/loader:1416:10) at Module.load (node:internal/modules/cjs/loader:1208:32) at Module._load (node:internal/modules/cjs/loader:1024:12) at Module.require (node:internal/modules/cjs/loader:1233:19) at require (node:internal/modules/helpers:179:18) at Object. (C:\Users\Administrator\AppData\Roaming\npm\node_modules\hfs\src\sse.js:5:17) at Module._compile (node:internal/modules/cjs/loader:1358:14) { errno: -4058, code: 'ENOENT', syscall: 'chdir', path: 'C:\Praveen\hfs-main', dest: '\Users\Administrator\.hfs' }

Node.js v20.15.1

rejetto commented 1 week ago

i'm still studying what exactly i should do about this problem, but in the meantime, you can work around it just by creating the missing folder, like \Users\Admin\.hfs or \Users\Administrator\.hfs