deepstreamIO/deepstream.io

Server crashes when start

RookTKO opened this issue · 1 comments

I'm following the docs and I have the following code

const { Deepstream } = require('@deepstream/server')

/*
The server can take
1) a configuration file path
2) null to explicitly use defaults to be overriden by server.set()
3) left empty to load the base configuration from the config file located within the conf directory.
4) pass some options, missing options will be merged from the base configuration.
*/
const server = new Deepstream()

// start the server
server.start()

And I'm calling it in the terminal and its giving me this issue:

(node:26328) UnhandledPromiseRejectionWarning: Error: No config file found
    at getDefaultConfigPath (C:\ds-demo-spaceshooter-master\ds-demo-spaceshooter-master\node_modules\@deepstream\server\src\config\js-yaml-loader.ts:194:9) 
    at setGlobalConfigDirectory (C:\ds-demo-spaceshooter-master\ds-demo-spaceshooter-master\node_modules\@deepstream\server\src\config\js-yaml-loader.ts:129:7)
    at Object.loadConfigWithoutInitialization (C:\ds-demo-spaceshooter-master\ds-demo-spaceshooter-master\node_modules\@deepstream\server\src\config\js-yaml-loader.ts:61:22)
    at Object.loadConfig (C:\ds-demo-spaceshooter-master\ds-demo-spaceshooter-master\node_modules\@deepstream\server\src\config\js-yaml-loader.ts:87:24)    
    at Deepstream.loadConfig (C:\ds-demo-spaceshooter-master\ds-demo-spaceshooter-master\node_modules\@deepstream\server\src\deepstream.io.ts:465:35)       
    at new Deepstream (C:\ds-demo-spaceshooter-master\ds-demo-spaceshooter-master\node_modules\@deepstream\server\src\deepstream.io.ts:91:10)
    at Object.<anonymous> (C:\ds-demo-spaceshooter-master\ds-demo-spaceshooter-master\srcServer.js:10:16)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:26328) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:26328) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I was under the impression I don't need to use any config file?
I'm currently using the LTS of Node. (14.16.0)

Anyone have any thoughts on the matter?

Hi, which docs are you following ? Here is the correct description: https://deepstream.io/docs/server/node-api/

In summary just do this: const server = new Deepstream({}) whith an empty object to use the default options.