node-redis-server icon indicating copy to clipboard operation
node-redis-server copied to clipboard

Spawing the server in VSCode debugger does not work

Open pke opened this issue 4 years ago • 3 comments

On Windows I am trying to open the server inside a VSCode debugger session and while the server is in the path and is spawned, the output stream handler is called only once with an empty buffer and then the whole node process is terminated. No other redis server is running at that time.

redis-server 1.2.2

//index.js
const RedisServer = require("redis-server")

// Simply pass the port that you want a Redis server to listen on.
const server = new RedisServer({
  bin: "c:/redis/redis-server.exe",
  port: 5555
});

async function main() {
  await server.open() // <-- this line causes the process to exit
  await server.close()
}

main()

package.json

{
  "name": "redis-server-test",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "dependencies": {
    "redis-server": "1.2.2"
  }
}

pke avatar Oct 13 '19 21:10 pke