Voxelum / minecraft-launcher-core-node

Provide packages to install Minecraft, launch Minecraft and more to build launcher with NodeJs/Electron!
https://docs.xmcl.app/en/core/
MIT License
174 stars 25 forks source link

HTTP Error: Status code 404 when i want to download Forge #215

Closed Burstyx closed 2 years ago

Burstyx commented 2 years ago

I have a problem when i want to download Forge with installForgeTask(). I have

Here is my code: image

When i launch the electron app i have these errors: image

I use these dependencies: image

I don't know why this error append. I'm afraid we can't fix this error because apparently the certificate has expired

ci010 commented 2 years ago

The installer will try to install forge from files.minecraftforge.net, but it seems the forge's https is expired.

I suggest you to create an agent with rejectUnauthorized: false to handle all downloads.

const https = require('https')

// this is for https
const agent = https.Agent({ rejectUnauthorized: false, /* Please also set other options like max sockets here. */  })

installForgeTask(forgeVersion, location, { agents: { https: agent } })
Burstyx commented 2 years ago

The installer will try to install forge from files.minecraftforge.net, but it seems the forge's https is expired.

I suggest you to create an agent with rejectUnauthorized: false to handle all downloads.

const https = require('https')

// this is for https
const agent = https.Agent({ rejectUnauthorized: false, /* Please also set other options like max sockets here. */  })

installForgeTask(forgeVersion, location, { agents: { https: agent } })

Thanks now it work but i have a new problem ;( image i enter this version of forge but i don't know why but the module search in the wrong folder :/ image

Burstyx commented 2 years ago

Good the problem is gone I just have to update Electron to the latest version thanks ^^