1

I'm trying to run NodeJS on my school computer, and all it has is java, so I'm trying to find a way to run it. The closest I've come is Trireme, but it generates the following errors:

missing ; before statement
missing ; before statement
    at module.js:439:0
    at module.js:474:0
    at module.js:356:0
    at module.js:312:0
    at module.js:364:0
    at require (module.js:380:0)
    at index.js:6:0
    at module.js:456:0
    at module.js:474:0
    at module.js:356:0
    at module.js:312:0
    at module.js:497:0
    at startup (trireme.js:142:0)
    at trireme.js:923:0

I'm running trireme with java -jar trireme.jar index.js, and the NodeJS code is

const fs = require('fs');
const express = require('express');
const app = express();
const http = require('http');
const server = http.createServer(app);
const { Server } = require('socket.io');
const io = new Server(server);

app.set('view engine', 'pug');
app.set('views', __dirname + '/templates');

server.listen(3000, () => {
  console.log('listening on *:3000');
});

require('./routes.js')(app, fs);
require('./io.js')(io, fs);

It almost works, but not quite. I don't know how to fix these bugs though.

Omay
  • 11
  • 3
  • Omay, you'll need to add more details to the question. What code are you trying to run? How have you invoked Trireme, from the command line or embedded in a Java application? – Tim Moore Feb 03 '22 at 04:42
  • Also, you might be interested in this known issue https://github.com/apigee/trireme/issues/190 – Tim Moore Feb 03 '22 at 04:44

1 Answers1

0

Check this out: How should I run NodeJS from a Java application?. Hope it helps. Or you should maybe try Spring as an alternative to NodeJS

TCoder12
  • 1
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Feb 03 '22 at 11:13