node-minecraft-wrap
node-minecraft-wrap copied to clipboard
Internal issue
I keep on getting this error:
events.js:291
throw er; // Unhandled 'error' event
^
Error: spawn java ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:268:19)
at onErrorNT (internal/child_process.js:464:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:274:12)
at onErrorNT (internal/child_process.js:464:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn java',
path: 'java',
spawnargs: [
'-jar',
'-Xms1024M',
'-Xmx1024M',
'./minecraft/Server.jar',
'nogui'
]
}
what is your code?
Code:
function done(){
console.log('done')
}
const wrap = require("minecraft-wrap")
const Server = new wrap.WrapServer("./minecraft/server.js","./minecraft", {})
Server.on('line', function (line) {
console.log(line)
})
Server.startServer({
motd: 'more coming soon!',
'max-players': 50
}, function (err) {
if (err) {
console.log(err)
return
}
console.log('Server Started !')}, done)
Also I strongly reccommend you guys get a discord server or any other form of live chat.
Code:
function done(){
console.log('done')
}
const wrap = require("minecraft-wrap")
const Server = new wrap.WrapServer("./minecraft/server.js","./minecraft", {})
Server.on('line', function (line) {
console.log(line)
})
Server.startServer({
motd: 'more coming soon!',
'max-players': 50
}, function (err) {
if (err) {
console.log(err)
return
}
console.log('Server Started !')}, done)
Also I strongly reccommend you guys get a discord server or any other form of live chat.
we have a discord server: https://discord.gg/XzJeudtY
Code:
function done(){
console.log('done')
}
const wrap = require("minecraft-wrap")
const Server = new wrap.WrapServer("./minecraft/server.js","./minecraft", {})
Server.on('line', function (line) {
console.log(line)
})
Server.startServer({
motd: 'more coming soon!',
'max-players': 50
}, function (err) {
if (err) {
console.log(err)
return
}
console.log('Server Started !')}, done)
Also I strongly reccommend you guys get a discord server or any other form of live chat.
also, for the code: you're using the function wrong. take a look at the example: https://github.com/PrismarineJS/node-minecraft-wrap/blob/master/examples/exampleWrapServer.js