minecraft-launcher-core-node icon indicating copy to clipboard operation
minecraft-launcher-core-node copied to clipboard

ForgeInstaller doesn't work

Open ecustic opened this issue 5 years ago • 3 comments

const minecraft = path.resolve(__dirname, 'client')
try {
    const res = await ForgeInstaller.install({ version: '31.2.9', mcversion: '1.15.2' }, minecraft)
    console.log(res)
} catch (err) {
    console.log(err)
}
console.log('done')

Running the above just exits the application after ForgeInstaller.install. None of the console.log statements run, and only the following is output in the versions folder in the client:

+ versions
    + 1.15.2-forge-31.2.9
        + 1.15.2-forge-31.2.9.json
        + install_profile.json

Running on Windows 10 (2004), Node 14, with:

"@xmcl/core": "^2.3.1",
"@xmcl/installer": "^2.9.1",

I expect I might be doing something wrong, but I also expect to be able to catch the error and not have the application force quit.

ecustic avatar Jun 12 '20 18:06 ecustic

You need to run Installer.installDependencies after installing forge. Also note that because you are installing a Minecraft version above 1.13, you need to have java installed. If the java executable is already in your PATH environment variable, you should be fine. Otherwise, you need to specify the java option.

I have no idea why none of the console.log statements are running. Maybe try using NodeJS 12?

lukechu10 avatar Jun 12 '20 20:06 lukechu10

I've narrowed it down to being the node version. Running it with 12.0.0 works fine. With node 14.0.0 the process immediately exits when you call ForgeInstaller.install.

ecustic avatar Jun 12 '20 20:06 ecustic

I've narrowed it down to being the node version. Running it with 12.0.0 works fine. With node 14.0.0 the process immediately exits when you call ForgeInstaller.install.

That is a problem. I'll checkout if node 14 affect the result.

Update: I tried run the test on my local machine with njs14, but it seems the test passed. Does the process exited means the renderer process exit?

ci010 avatar Jun 13 '20 03:06 ci010