Deploy sao on Windows

Hi @ced

I open the sao folder from inside the tryton folder which I download during executing cookiecutter,
then I read the README.md … so what I did:

  1. I enter the sao folder, then open the folder in VSCode,
  2. From VSCode terminal I installing nodejs → version 12.22.9
  3. Then I install grunt-cli → version 1.4.3
  4. Together with grunt → version 1.4.1

After that I run command:

$ npm install --legacy-peer-dep

but got many errors, so I tried:

$ npm install --force or --legacy-peer-dep

The errors the same as below:

npm error code 1
npm error path \\wsl.localhost\Tryton-dev\root\.cookiecutters\tryton\sao\node_modules\puppeteer
npm error command failed
npm error command C:\WINDOWS\system32\cmd.exe /d /s /c node install.js
npm error '\\wsl.localhost\Tryton-dev\root\.cookiecutters\tryton\sao\node_modules\puppeteer'
npm error CMD.EXE was started with the above path as the current directory.
npm error UNC paths are not supported.  Defaulting to Windows directory.
npm error node:internal/modules/cjs/loader:1408
npm error   throw err;
npm error   ^
npm error
npm error Error: Cannot find module 'C:\Windows\install.js'
npm error     at Function._resolveFilename (node:internal/modules/cjs/loader:1405:15)
npm error     at defaultResolveImpl (node:internal/modules/cjs/loader:1061:19)
npm error     at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1066:22)
npm error     at Function._load (node:internal/modules/cjs/loader:1215:37)
npm error     at TracingChannel.traceSync (node:diagnostics_channel:322:14)
npm error     at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
npm error     at Function.executeUserEntryPoint [as runMain]     (node:internal/modules/run_main:151:5)
npm error     at node:internal/main/run_main_module:33:47 {
npm error   code: 'MODULE_NOT_FOUND',
npm error   requireStack: []
npm error }
npm error
npm error Node.js v23.9.0
npm error A complete log of this run can be found in: C:\Users\appfu\AppData\Local\npm-cache\_logs\2025-03-27T11_44_48_091Z-debug-0.log

Is this because I am using Window WSL2 ??

Should I use pure Ubuntu using VMWare for example??

Can I deploy sao inside my host machine (windows 11) as separate service?.. then accessing Trytond server inside Ubuntu wsl? … if yes.. I can separate it.. sao running in Windows and Tryton running in Ubuntu..

Best regards
Bromo

I do not know. I do not use Windows.

No sao must be served by the trytond service.

1 Like

Hi @ced I managed to npm install the sao project… yes the error above caused by I am using WSL2 under Windows.. and both environment has the same version of Node… so I managed to run install by downgrading my node version in WSL..
Anyway.. thanks bro

Best regards
Bromo

Hi @ced sorry to bother u again.. I follow what u said, I go and read README.md from SAO repo u gave

I managed to run:

$ npm install --force or --legacy-peer-dep

And all went well, my node_modules folder populated with required dependencies. But then I continue to run:

$ grunt

And I got these error:

Error: Cannot find module 'liftup'
Require stack:
- /usr/share/nodejs/grunt-cli/bin/grunt
    at Module._resolveFilename (node:internal/modules/cjs/loader:1212:15)
    at Module._load (node:internal/modules/cjs/loader:1043:27)
   at Module.require (node:internal/modules/cjs/loader:1298:19)
   at require (node:internal/modules/helpers:182:18)
   at Object.<anonymous> (/usr/share/nodejs/grunt-cli/bin/grunt:7:14)
   at Module._compile (node:internal/modules/cjs/loader:1529:14)
   at Module._extensions..js (node:internal/modules/cjs/loader:1613:10)
   at Module.load (node:internal/modules/cjs/loader:1275:32)
   at Module._load (node:internal/modules/cjs/loader:1096:12)
  at Function.executeUserEntryPoint [as runMain] 
  (node:internal/modules/run_main:164:12) {
   code: 'MODULE_NOT_FOUND',
   requireStack: [ '/usr/share/nodejs/grunt-cli/bin/grunt' ]
}

FYI: I previously install grunt using below command:

$ apt install node-grunt-cli

Any idea what’s going on?

Anyway .. in the README.md at SAO repo there is a line:

Note that the entry `root` in the section `[web]` of `trytond.conf` must be set to the directory where the package was unpacked.

Where is trytond.conf file located?

It is probably better to run grunt installed locally by npm.
You can use npx grunt

1 Like

Hi @ced ,

Done. I execute below command:

$ ~/.cookiecutters/tryton/sao# npx grunt --gruntfile Gruntfile.js --force

And it managed to successfully runs with deprecation warnings. Thanks to you :grinning_face:

:backhand_index_pointing_right: Now based on the README.md u gave me (sao/README.md · branch/7.4 · Tryton / Tryton · GitLab), I need to change an entry in [web] section in the trytond.cfg file.

So I search that trytond.cfg from the entire tryton folder project under ~/.cookiecutters/ folder (downloaded at the 1st time after executing cookiecutter during module project creation). But I found there are few tryton.cfg files such as:

  1. Under trytond\trytond\tests
  2. Under \trytond\trytond\res
  3. Under \trytond\trytond\ir
  4. and many many others

@ced could you tell me where or which one is it?

Thanks in advance
Bromo

Note that the readme says: trytond.conf and you are asking for trytond.cfg which is not the same, so take a look at docs, I don’t know if there is already a default file somewhere but probably you will have to create it manually.
Hope it helps.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.