minecraft-launcher-core-node
minecraft-launcher-core-node copied to clipboard
ForgeInstaller doesn't work
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.
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?
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.
I've narrowed it down to being the node version. Running it with
12.0.0works fine. With node14.0.0the process immediately exits when you callForgeInstaller.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?