Jonas
Jonas11mo ago

Compile to exe

Every time I run my exe I get the following error: But when I start my code normally with node main.js it works without problems. This is my code:
import chalk from "chalk";
import figlet from "figlet";
import gradient from "gradient-string";
import { choose, programInfo } from "./lib/helper.js";
import dotenv from "dotenv";

//Config
dotenv.config();

//Main
const currentVersion = Number(process.env.VERSION);
const serverVersion = await programInfo();

if (currentVersion !== serverVersion.version) {
console.log(
chalk.red(
"Your version is outdated. Please update to the latest version to continue."
)
);
process.exit(0);
}

await choose();
import chalk from "chalk";
import figlet from "figlet";
import gradient from "gradient-string";
import { choose, programInfo } from "./lib/helper.js";
import dotenv from "dotenv";

//Config
dotenv.config();

//Main
const currentVersion = Number(process.env.VERSION);
const serverVersion = await programInfo();

if (currentVersion !== serverVersion.version) {
console.log(
chalk.red(
"Your version is outdated. Please update to the latest version to continue."
)
);
process.exit(0);
}

await choose();
No description
2 Replies
divy
divy11mo ago
import process from "node:process"
import process from "node:process"
Add this import ^
Jonas
JonasOP11mo ago
Thank you very much :deno_thankyou:

Did you find this page helpful?