Broken WebUI after Node.JS Update

Hi everyone. Hope someone can help with this. My webui was not giving me updated profiles, so I decided to update the webui.

However when doing this it said my node.js was out of data and if I would like to update it, I put in some sort of command and updated the webui. However now I cannot do the webui update.

I get the following errors:

root@mineos-tkldev /home/mc# cd /usr/games/minecraft
root@mineos-tkldev …/games/minecraft# git fetch
root@mineos-tkldev …/games/minecraft# git reset --hard origin/master
HEAD is now at c04a177 fix misslabled class initialization (#430)
root@mineos-tkldev …/games/minecraft# rm -rf node_modules
root@mineos-tkldev …/games/minecraft# npm install --unsafe-perm
npm does not support Node.js v8.17.0
You should probably upgrade to a newer version of node as we
can’t make any promises that npm will work with this version.
You can find the latest version at https://nodejs.org/
/usr/lib/node_modules/npm/lib/npm.js:32
#unloaded = false
^

SyntaxError: Invalid or unexpected token
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:617:28)
at Object.Module._extensions…js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at module.exports (/usr/lib/node_modules/npm/lib/cli.js:22:15)
root@mineos-tkldev …/games/minecraft#

Also I cannot access the webui at all.

Please can someone help. I can access via putty and just need someone to tell me the commands I need to undo what I did or fix the websui

Please help!

Ok I followed the guide to do the dependencies from here:

https://minecraft.codeemo.com/mineoswiki/index.php?title=MineOS-node_(apt-get)

I did the following commands:

curl -sL https://deb.nodesource.com/setup_10.x | bash -
apt-get -y install nodejs

This seemed to install the node.js I needed. I then proceeded to reset the webui with:

cd /usr/games/minecraft
git fetch
git reset --hard origin/master
rm -rf node_modules
npm install --unsafe-perm
chmod +x mineos_console.js

I still get some errors in but the webui is back now but very messed up.

When I do this command:
git reset --hard origin/master

I get the following error:
HEAD is now at c04a177 fix misslabled class initialization (#430)

Could this be the issue and how can I fix?

Doing - npm install --unsafe-perm
Gives me the following:
found 41 vulnerabilities (7 low, 14 moderate, 18 high, 2 critical)
run npm audit fix to fix them, or npm audit for details

So I’m a little worried now the system needs updating and is now vulnerable?

@hexparrot please could you tell me what this all means and how to fix?

After doing this command:

git reset --hard origin/master

I get the following error

HEAD is now at c04a177 fix misslabled class initialization (#430)

Please can someone help me fix this. What commands do I need!

I have also run into this, but it happened after I got an error from NPM telling me to update to the new minor update. I ran # npm install -g npm as it suggested and now I get the same output as this user. I have not attempted a manual forced update of node.js, as the output suggests.

Related command results:

#node -v: v8.17.0

I managed to fix this by updating nodejs with the following commands.

#curl -sL https://deb.nodesource.com/setup_12.x | bash -
#apt-get install -y nodejs

Then verify with:

#node -v
v12.22.7
#npm version
npm: ‘6.14.15’,

Instructions gleaned from How to Install Node.js on Ubuntu and Update npm to the Latest Version

UPDATE: I was able to use nvm (via the instructions at the link above) to get a successful nodejs/npm build of mineos using node v14.18.2 The 16 series will not build properly. I assume the nodesource instructions for 14.x would also work. After this build I had to do the instructions for resetting the webui. Don’t forget to restart mineos.

1 Like

@Lawrence_Mitchell

Thanks so much for this. However I’m still getting this error:

HEAD is now at c04a177 fix misslabled class initialization (#430)

When I try to reset with #git reset

My Webui is there but is unusable and is not displayed properly. Do you have any idea what this error is and how to fix it?

That response is normal behavior. After that you need to do the remaining commands and then restart mineos

@Lawrence_Mitchell

Yes I did continue with the remainder of the steps, however on doing - npm install --unsafe-perm

Gives me the following:
found 41 vulnerabilities (7 low, 14 moderate, 18 high, 2 critical)
run npm audit fix to fix them, or npm audit for details

I can do the audit fix force command but it cannot fix most of them, and they apparently need manual fixes which I have no idea how to do.

I used to fix the WebUI with all the commands before but never experience all these issues and errors.

My WebUI is back, but the profiles are missing the PaperMC and Waterfall profiles that I use. How can I fix the errors and also get my profiles back.

Anyone can help please?

Don’t worry about the vulnerabilities - that is normal.
For the profiles you need to download a few new files, Paper changed their API.
Unfortunately Hexparrot hasn’t been around to pull these in to his github. you can download them manually or replace your mineos installation with mine (GitHub - flareofghast/mineos-node: node.js implementation of mineos minecraft management) which has that plus a way to change java binary from the UI (which still has some manual steps).

Hi.
The above is not an error message, but a message stating success.
HEAD is the main developmend thread.
c04a177 is the latest MineOS build number
“fix misslabled class initialization (#430)” is the update message that states what the latest release fixes or changes.

It is in other words standard GIT messges.

The NPM volurabilities comes from dependencies in MIneOS to older NPM builds and addons. You can ignore them (or rather must), since updating NPM and dependencies to far breaks MineOS

1 Like