Open Chat Studio - npm run dev fails

Hi All,
(I am not sure if this is the right place to post or should I open a Github issue, my apologies if its not the right place)

I am setting up open chat studio on Ubuntu 22.04, and running npm run dev throws an error: see error log below:
info it worked if it ends with ok
1 verbose cli [
1 verbose cli '/home/ronald/.nvm/versions/node/v14.21.3/bin/node',
1 verbose cli '/home/ronald/.nvm/versions/node/v14.21.3/bin/npm',
1 verbose cli 'run',
1 verbose cli 'dev'
1 verbose cli ]
2 info using npm@6.14.18
3 info using node@v14.21.3
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle open-chat-studio@1.0.0~predev: open-chat-studio@1.0.0
6 info lifecycle open-chat-studio@1.0.0~dev: open-chat-studio@1.0.0
7 verbose lifecycle open-chat-studio@1.0.0~dev: unsafe-perm in lifecycle true
8 verbose lifecycle open-chat-studio@1.0.0~dev: PATH: /home/ronald/.nvm/versions/node/v14.21.3/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/ronald/open-chat-studio/node_modules/.bin:/home/ronald/open-chat-studio/openchat/bin:/home/ronald/.nvm/versions/node/v14.21.3/bin:/home/ronald/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Program Files/Python312/Scripts/:/mnt/c/Program Files/Python312/:/mnt/c/windows/system32:/mnt/c/windows:/mnt/c/windows/System32/Wbem:/mnt/c/windows/System32/WindowsPowerShell/v1.0/:/mnt/c/windows/System32/OpenSSH/:/Docker/host/bin:/mnt/c/Users/ADMIN/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/ADMIN/AppData/Local/Programs/Microsoft VS Code/bin:/mnt/c/Users/ADMIN/AppData/Local/GitHubDesktop/bin:/snap/bin
9 verbose lifecycle open-chat-studio@1.0.0~dev: CWD: /home/ronald/open-chat-studio
10 silly lifecycle open-chat-studio@1.0.0~dev: Args: [ '-c', 'webpack --mode development' ]
11 silly lifecycle open-chat-studio@1.0.0~dev: Returned: code: 1 signal: null
12 info lifecycle open-chat-studio@1.0.0~dev: Failed to exec dev script
13 verbose stack Error: open-chat-studio@1.0.0 dev: webpack --mode development
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (/home/ronald/.nvm/versions/node/v14.21.3/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:400:28)
13 verbose stack at ChildProcess. (/home/ronald/.nvm/versions/node/v14.21.3/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:400:28)
13 verbose stack at maybeClose (internal/child_process.js:1088:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:296:5)
14 verbose pkgid open-chat-studio@1.0.0
15 verbose cwd /home/ronald/open-chat-studio
16 verbose Linux 5.15.133.1-microsoft-standard-WSL2
17 verbose argv "/home/ronald/.nvm/versions/node/v14.21.3/bin/node" "/home/ronald/.nvm/versions/node/v14.21.3/bin/npm" "run" "dev"
18 verbose node v14.21.3
19 verbose npm v6.14.18
20 error code ELIFECYCLE
21 error errno 1
22 error open-chat-studio@1.0.0 dev: webpack --mode development
22 error Exit status 1
23 error Failed at the open-chat-studio@1.0.0 dev script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Environment:
OS Ubuntu 22.04 (WSL 2)
Node v14.21.3
NPM 6.14.18
Python Python 3.11.0rc1

Hi Ronald

Thanks for reaching out. Just looking at the trace above there doesn't appear to be any specific error message:

11 silly lifecycle open-chat-studio@1.0.0~dev: Returned: code: 1 signal: null
12 info lifecycle open-chat-studio@1.0.0~dev: Failed to exec dev script

But I do notice that you are running node v14 and npm v6. We currently only support node >= v18. Could you try and upgrade your node version and try again? I would suggest you use nvm to manage your node versions.

I see we don't mention anything about node versions in the readme so I'll update that.

Hi Simon,

Upgrading the node version to v 18 solved my problem. Where is the best place to chat and ask about Open chat? On this forum or Github issues?

Thank you very much for your assistance.

Great that you were able to get that sorted out.

This forum is probably the best place to chat about issues unless you find a specific bug which you'd like to report in which case you can create an issue on GitHub.

If you have any other suggestions to improve the dev onboarding process please also let us know or create a PR to update the docs / tools etc.

Thanks!

Hi Simon,

Noted, is it possible to create an open chat studio category/tag? When you post for the first time based on the existing categories/tags one gets the impression that the forum is dedicated to Commcare only.

I see you have a pull request for the Node version issue, I suggest we move that section to the top under Dev Environment Setup, we could add a Prerequisites section and list:
Node v 18+
Invoke
The invoke dependence is mentioned but is not clear to a first time user. I tried running the inv commands before installing Invoke and the errors you get are not helpful.

I doubt if inv setup-dev-env is running ./manage.py runserver (I checked the task.py file and I could not find the command). Even if it is run, it is not clear to a first-time user how to access open chat studio after running the command. I suggest we have clear instructions on to how to access open chat studio in the browser (URL and port number) in the README and Wiki