EmonCMS Install Script Error

please can someone help I get the following error when I run the install script on ubuntu 20 system

Install Emoncms Core Modules
/opt/openenergymonitor/EmonScripts/install/emoncms_modules.sh: line 8: cd: /var/www/emoncms/Modules: No such file or directory
- Module dashboard already exists
- Module device already exists
- Module app already exists
- Module graph already exists
- Module postprocess already exists
- Module demandshaper already exists
- Module backup already exists
- Module sync already exists
- Module usefulscripts already exists
Update Emoncms database
PHP Warning:  chdir(): No such file or directory (errno 2) in /opt/openenergymonitor/EmonScripts/common/emoncmsdbupdate.php on line 8
PHP Warning:  require(process_settings.php): failed to open stream: No such file or directory in /opt/openenergymonitor/EmonScripts/common/emoncmsdbupdate.php on line 9
PHP Fatal error:  require(): Failed opening required 'process_settings.php' (include_path='.:/usr/share/php') in /opt/openenergymonitor/EmonScripts/common/emoncmsdbupdate.php on line 9

Hello @Oddi_Ferreira Im not sure what has gone wrong here to cause this. It maybe that earlier in the process one of the steps did not complete correctly resulting in a broken install further down the line. Could you try the script again to see if it passes a second time?

If it persists I will have to run the script here to see if I can replicate the issue.

@TrystanLea yes the script had failed in between few times and had to restart finally after completing it started giving this error, the issue was resolved after a clean install of ubuntu.(Maybe due to the user not having full rights to the root directory, later done with the root user)

The script instructions give a method to create a ‘pi’ user on the Ubuntu instance, and add it to SUDO to avoid that. Not tested with latest release of Ubuntu.

From what I’ve read, it’s bad juju to install anything as the root user.
With some things, you have no choice. But it’s not a habit one wants to get into.