deepstreamIO / deepstream.io

deepstream.io server
https://deepstreamio.github.io
MIT License
7.13k stars 382 forks source link

Can't start deepstream6 after installing mac pkg #1113

Closed geohuz closed 2 years ago

geohuz commented 2 years ago
deepstream
internal/modules/cjs/loader.js:267
    throw e;
    ^

SyntaxError: Error parsing /usr/local/bin/dist/package.json: Unexpected end of JSON input
    at parse (<anonymous>)
    at readPackage (internal/modules/cjs/loader.js:254:20)
    at readPackageScope (internal/modules/cjs/loader.js:279:19)
    at shouldUseESMLoader (internal/modules/run_main.js:36:15)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:67:24)
    at internal/main/run_main_module.js:17:47 {
  path: '/usr/local/bin/dist/package.json'
}

MacOS version 12.1, node v14.17.5 can't figure out the problem.

voldegao commented 2 years ago

i have the same problem in windows 10

$ deepstream.exe start internal/modules/cjs/loader.js:267 throw e; ^

SyntaxError: Error parsing C:\deepstream\dist\package.json: Unexpected end of JSON input at parse () at readPackage (internal/modules/cjs/loader.js:254:20) at readPackageScope (internal/modules/cjs/loader.js:279:19) at shouldUseESMLoader (internal/modules/run_main.js:36:15) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:67:24) at internal/main/run_main_module.js:17:47 { path: 'C:\deepstream\dist\package.json' }

jaime-ez commented 2 years ago

Ok I can confirm the issue on linux also. Sorry this was a faulty release but I use deepstream as a node module, not as a standalone binary.

This is a nexe issue, the package bundler. I've tried to fix it but didn't succeed. Maybe a switch to pkg would be the best option by now, nexe is full of problems.

relevant nexe issues: https://github.com/nexe/nexe/issues/812 https://github.com/nexe/nexe/issues/754

The easiest solution for the time being is that you install deepstream as a node module and run the binary from node_modules/@deepstream/server/dist/bin/deepstream

jaime-ez commented 2 years ago

Switching to pkg instead of nexe.

Please try the new executables from release v6.0.1, works in linux at least

geohuz commented 2 years ago

6.0.1 works in Macos now!

jaime-ez commented 2 years ago

windows works also

Please reopen if issue persists

krishnarastogi commented 2 years ago

Unable to run the docker image from the Dockerfile

internal/modules/cjs/loader.js:638
    throw err;
    ^

Error: Cannot find module '/bin/deepstream.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
jaime-ez commented 2 years ago

HI, docker is running ok for me on Linux 18:

sudo docker run -p 6020:6020 deepstreamio/deepstream.io
Unable to find image 'deepstreamio/deepstream.io:latest' locally
latest: Pulling from deepstreamio/deepstream.io
76b8ef87096f: Pull complete 
2e2bafe8a0f4: Pull complete 
b53ce1fd2746: Pull complete 
84a8c1bd5887: Pull complete 
7a803dc0b40f: Pull complete 
b800e94e7303: Pull complete 
0da9fbf60d48: Pull complete 
04dccde934cf: Pull complete 
73269890f6fd: Pull complete 
710ca6944de8: Pull complete 
732a8221fa9b: Pull complete 
ff2511739bb0: Pull complete 
Digest: sha256:6e8249c1b0f035fb488d71034ee976916d5c42dedb2862800347d4d85a54a3b0
Status: Downloaded newer image for deepstreamio/deepstream.io:latest
Debugger listening on ws://0.0.0.0:9229/debb6c78-45af-47c8-8c77-29b967e37ff1
For help, see: https://nodejs.org/en/docs/inspector
      _                     _ 
   __| | ___  ___ _ __  ___| |_ _ __ ___  __ _ _ __ ____ 
  / _` |/ _ \/ _ \ '_ \/ __| __| '__/ _ \/ _` | '_ ` _  \
 | (_| |  __/  __/ |_) \__ \ |_| | |  __/ (_| | | | | | |
  \__,_|\___|\___| .__/|___/\__|_|  \___|\__,_|_| |_| |_|
                 |_|
=====================   starting   =====================
CONFIG_TRANSFORM | Loaded content from /conf/permissions.yml for fileLoad(permissions.yml)
INFO | logger ready: std out/err at level INFO
INFO | server name: kyxuf3yd-11nx30sfhczk0
INFO | deepstream version: 6.0.1
INFO | configuration file loaded from conf/config.yml
CLUSTER_JOIN | kyxuf3yd-11nx30sfhczk0
CLUSTER_SIZE | The cluster size is now 1
TELEMETRY | INFO | Telemetry disabled
INFO | monitoring ready: Noop Monitoring
INFO | subscriptions ready: Subscription Registry
INFO | storage ready: Noop Storage
INFO | cache ready: Local Cache
INFO | permission ready: Valve Permissions
INFO | locks ready: Distributed Lock Registry
INFO | clusterNode ready: Single Cluster Node
INFO | clusterRegistry ready: Distributed Cluster Registry
INFO | clusterStates ready: Distributed State Registry
INFO | telemetry ready: Deepstream Telemetry
INFO | authentication ready: Open Authentication
INFO | Listening for http connections on 0.0.0.0:6020
INFO | Listening for health checks on path /health-check
INFO | httpService ready: NodeJS HTTP Service
INFO | connectionEndpoint ready: Binary WebSocket Connection Endpoint
INFO | connectionEndpoint ready: WS Text Protocol Connection Endpoint
INFO | connectionEndpoint ready: WS Text Connection Endpoint
INFO | connectionEndpoint ready: HTTP connection endpoint
INFO | Deepstream started