Hass not starting up after upgrade

Hi,

I was on 2021.01 before today and it was working fine. I don’t know what got into me and I decided to upgrade home assistance to lates 2021.06.

Ran the upgrade which went fine, ran hass --script check-config which ran fine. But when I try to run hass, it gives me following error.

0|hass | /data/data/com.termux/files/usr/bin/hass:2
0|hass | # -- coding: utf-8 --
0|hass | ^
0|hass | SyntaxError: Invalid or unexpected token
0|hass | at wrapSafe (internal/modules/cjs/loader.js:979:16)
0|hass | at Module._compile (internal/modules/cjs/loader.js:1027:27)
0|hass | at Object.Module._extensions…js (internal/modules/cjs/loader.js:1092:10)
0|hass | at Module.load (internal/modules/cjs/loader.js:928:32)
0|hass | at Function.Module._load (internal/modules/cjs/loader.js:769:14)
0|hass | at Object. (/data/data/com.termux/files/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:33:23)
0|hass | at Module._compile (internal/modules/cjs/loader.js:1063:30)
0|hass | at Object.Module._extensions…js (internal/modules/cjs/loader.js:1092:10)
0|hass | at Module.load (internal/modules/cjs/loader.js:928:32)
0|hass | at Function.Module._load (internal/modules/cjs/loader.js:769:14)

Same error multiple time.
Does anyone know issue here?
Thank you.

I tried diff versions including going back to same old 2021.01 but even that is giving same error now.

Can anyone help please?

I’m using following to start hass server and that is the issue

  pm2 start hass

When I start hass manually, it worked.

  hass --config=/data/data/com.termux/files/home/.homeassistant

Now I need to check what is wrong with pm2 command.

try

pm2 start hass --interpreter=bash

I suspect pm2 assume javascript by default, and as the hass command doesn’t have an extension, it doesn’t guess it’s bash.