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.29k stars 227 forks source link

Error after update from 0.47.3 to 0.48.0 #351

Closed bvdcode closed 1 year ago

bvdcode commented 1 year ago

To Reproduce

FROM node:latest
WORKDIR /usr/src/app
EXPOSE 80
RUN npm -g i hfs@0.48.0
ENTRYPOINT [ "npx", "hfs" ]

Describe the bug Application does not starting - file central.json was not found - no such file or directory, open '/root/.npm/_npx/b9bd46112b720460/node_modules/hfs/central.json'

Environment (please complete the following information):

Additional context

Sending build context to Docker daemon  3.072kB
Step 1/5 : FROM node:latest
 ---> a7d783348d46
Step 2/5 : WORKDIR /usr/src/app
 ---> Using cache
 ---> a63915c4304c
Step 3/5 : EXPOSE 80
 ---> Using cache
 ---> c41c68df9eb9
Step 4/5 : RUN npm -g i hfs@latest
 ---> Using cache
 ---> d1d4273cf6aa
Step 5/5 : ENTRYPOINT [ "npx", "hfs" ]
 ---> Running in 2365dfcffc69
Removing intermediate container 2365dfcffc69
 ---> 608677366b19
Successfully built 608677366b19
Successfully tagged hfs:latest
[+] Running 1/1
 ⠿ Container hfs  Started                                                                                                                                                                                     13.7s
HFS ~ HTTP File Server - Copyright 2021-2023, Massimo Melina <a@rejetto.com>
License https://www.gnu.org/licenses/gpl-3.0.txt
started 9/20/2023, 2:10:21 AM 
version 0.48.0
build 2023-09-18T18:17:57.330Z
pid 22
cwd /root/.hfs
node v20.7.0
config config.yaml
node:internal/fs/utils:352
    throw err;
    ^

Error: ENOENT: no such file or directory, open '/usr/local/lib/node_modules/hfs/central.json'
    at readFileSyncUtf8 (node:internal/fs/read/utf8:20:3)
    at readFileSync (node:fs:466:12)
    at Object.<anonymous> (/usr/local/lib/node_modules/hfs/src/github.js:190:48)
    at Module._compile (node:internal/modules/cjs/loader:1241:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
    at Module.load (node:internal/modules/cjs/loader:1091:32)
    at Module._load (node:internal/modules/cjs/loader:938:12)
    at Module.require (node:internal/modules/cjs/loader:1115:19)
    at require (node:internal/modules/helpers:130:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/hfs/src/api.net.js:15:18) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/usr/local/lib/node_modules/hfs/central.json'
}

Node.js v20.7.0
bvdcode commented 1 year ago

0.47.3 works good

HFS ~ HTTP File Server - Copyright 2021-2023, Massimo Melina <a@rejetto.com>
License https://www.gnu.org/licenses/gpl-3.0.txt
started 9/20/2023, 1:54:23 AM 
version 0.47.3
build 2023-08-29T08:36:23.856Z
pid 22
cwd /root/.hfs
config config.yaml
HINT: type "help" for help
http serving on any network : 80
network eth0 http://192.168.0.2
cannot launch browser on this machine >PLEASE< open your browser and reach one of these (you may need a different address) 
 - http://192.168.0.2/~/admin/
loading plugin download-manager
loading plugin file-icons
loading plugin simple-media-viewer
loading plugin antibrute
loading plugin download-counter
loading plugin list-uploader
rejetto commented 1 year ago

thank you for reporting! should be fixed with 0.48.2.

and yet, i'm facing some problems when trying to run without the npm as you do. Normally npx should work even if run without npm, but with 0.48.* stopped doing so. So, you should be good anyway, but let me know

rejetto commented 1 year ago

357 i don't think this affects you, but you never know...