question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot Install minecraft

See original GitHub issue
const { install, getVersionList, Version} = require("@xmcl/installer/minecraft");

async function testinstall() {
    const minecraft="./minecraft";
    const list = await getVersionList();
    const aVersion = list[0];
    await install("client", aVersion, minecraft)
};
testinstall()

I just ran this code. Then an error occurred.

C:\Users\doohe\WebstormProjects\MRS-electronjs-launcher\node_modules\@xmcl\installer\minecraft.js:1
import { MinecraftFolder, Version as VersionJson } from "@xmcl/core";
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at Module._compile (internal/modules/cjs/loader.js:892:18)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Module.require (internal/modules/cjs/loader.js:849:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (C:\Users\doohe\WebstormProjects\MRS-electronjs-launcher\src\renderer\components\js\mchandler.js:1:45)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)

What’s wrong?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

0reactions
lukechu10commented, Mar 2, 2020

nvm, I managed to fix it. I have, however, another error which is caused by getVersionList: code:

import { getVersionList } from "@xmcl/installer"
console.log(getVersionList());

error:

TypeError: decompressResponse is not a function
    at Object.push../node_modules/@xmcl/installer/node_modules/got/dist/source/get-response.js.exports.default (get-response.js:15)
    at ClientRequest.handleResponse (request-as-event-emitter.js:121)
    at Object.onceWrapper (events.js:300)
    at ClientRequest.emit (events.js:215)
    at ClientRequest.origin.emit (index.js:39)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:583)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:115)
    at TLSSocket.socketOnData (_http_client.js:456)
    at TLSSocket.emit (events.js:210)
    at addChunk (_stream_readable.js:308)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Minecraft: Java Edition Installation Issues FAQ – Home
Firewalls and antivirus programs can sometimes cause trouble during installation. If you're having trouble installing Minecraft, you may want to temporarily ...
Read more >
Minecraft not installing on Windows 11/10 PC
Restart your PC · Update your OS · Install the alternative version of Minecraft · Run Minecraft installer as administrator · Delete Mod...
Read more >
Can't install Minecraft for Windows 10 - Microsoft Community
1) Try updating Store apps: https://support.microsoft.com/tr-tr/help/402625... · 2) Right click on the time and date in the far right corner of ...
Read more >
[SOLVED] Minecraft Windows 10 Won't Install Problem Issue
Causes of Minecraft Windows 10 Won't Install Issue · Outdated Windows · Outdated Microsoft Store · Older caches and temporary data of the...
Read more >
FIX Minecraft Launcher Not Downloading & Installing On ...
Minecraft Launcher Not Installing On Windows PCIn this video, I will be ... or installing this is how you can hopefully resolve the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found