[SOLVED]NodeJS error: SyntaxError: Use of const in strict mode

I am trying to install the new WebUI server.
I removed the old Python one.

After installing, when I try to execute the webservice:

mineos: ERROR (abnormal termination)

so I tried executing:

nodejs webui.js

But I got the below output:

/usr/games/minecraft/node_modules/fs-extra/lib/index.js:3
const assign = require(’./util/assign’)
^^^^^
SyntaxError: Use of const in strict mode.
at Module._compile (module.js:439:25)
at Object.Module._extensions…js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/usr/games/minecraft/mineos.js:1:72)
at Module._compile (module.js:456:26)
at Object.Module._extensions…js (module.js:474:10)
at Module.load (module.js:356:32)

The mineos.log at /var/log/ is empty

Any help??

hi sargeOrona,

above my pay grade but i like to chat, lol.

so i guess you are trying the old python style webservice ui?

if not mistaken and i am sure to be corrected, webservice access was blocked by default, same as root access. to enable search the forum a little to find what to enable with nano. (port?)

same thing regarding ports. only several are open by default and any service using a specific port may not work due to that port being closed by default. use nano to modify iptables, info here: https://minecraft.codeemo.com/mineoswiki/index.php?title=Iptables

most use the webui found at https://192.168.1.xxx:8443/admin/login.html

don’t forget about stuff like https://minecraft.codeemo.com/mineoswiki/index.php?title=MineOS-node_(apt-get)

good luck!

tNt

Thank you for replying tNt!

_

so i guess you are trying the old python style webservice ui?

_
Actually I was not able to make it work again, so I removed it (by deleting all the files from several locations) and I reinstalled the new NodeJS one, however I have not been able to make it work.

don’t forget about stuff like https://minecraft.codeemo.com/mineoswiki/index.php?title=MineOS-node_(apt-get)

I followed all the steps from that tutorial actually.

Trying to start if from supervisor throws the below error:

mineos: ERROR (abnormal termination)

So I am not sure what else to check…

This error is quite common on earlier, non-release versions of Node, e.g., 0.10.x, rather than the 4.x series. Can you confirm what version of NodeJS you are using?

root@mineos games/minecraft# nodejs -v
v4.5.0

If nodejs older than this, e.g., 0.10.12, it means you likely installed it via official Debian/Ubuntu repositories (which are out of date!)

Check the wiki for instructions on installing 4.x or 5.x (not higher though!). When you’re done, rebuild your modules:

root@mineos ~# cd /usr/games/minecraft/
root@mineos games/minecraft# rm -rf /usr/games/minecraft/node_modules
root@mineos games/minecraft# npm install

@hexparrot senpai!!!

That did the trick, I reinstalled by running the below command as root:

curl -sL https://deb.nodesource.com/setup_4.x | bash -

Then I reloaded everything as suggested.

root@mineos ~# cd /usr/games/minecraft/
root@mineos games/minecraft# rm -rf /usr/games/minecraft/node_modules
root@mineos games/minecraft# npm install

The server is up and running again!
Thank you!!