Development enviroment for SAO web client

Hi,

I was trying to deploy the SAO client. I use vscode to coding, my python’s virtual environment for trytond works fine.

The steps I’ve follow was

All looks fine until this. Then I execute

  • grunt
(venv) julio@julio-ntb:~/Development/workspace-python/tryton/facturacion/sao$ grunt
internal/modules/cjs/loader.js:638
    throw err;
    ^

Error: Cannot find module 'liftoff'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/usr/share/nodejs/grunt-cli/bin/grunt:7:15)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)

At here I tried to install liftoff with pip, not worked. I test npm install liftoff unsuccessful.

How can I add this missed module?

This looks like a nodejs version issue. Maybe you can try:

I will read this post, but you have a node version where it works correctly to recommend.
Actually my node version is

(venv) julio@julio-ntb:~/Development/workspace-python/tryton/facturacion/sao$ node --version
v10.23.2

My node version is v14.15.4

Same issue updated my node to the last version

(venv) julio@julio-ntb:~/Development/workspace-python/tryton/facturacion/sao$ grunt
node:internal/modules/cjs/loader:928
  throw err;
  ^

Error: Cannot find module 'liftoff'
Require stack:
- /usr/share/nodejs/grunt-cli/bin/grunt
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:925:15)
    at Function.Module._load (node:internal/modules/cjs/loader:769:27)
    at Module.require (node:internal/modules/cjs/loader:997:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at Object.<anonymous> (/usr/share/nodejs/grunt-cli/bin/grunt:7:15)
    at Module._compile (node:internal/modules/cjs/loader:1108:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
    at Module.load (node:internal/modules/cjs/loader:973:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/usr/share/nodejs/grunt-cli/bin/grunt' ]
}

:frowning: :pensive:

current node version

(venv) julio@julio-ntb:~/Development/workspace-python/tryton/facturacion/sao$ node --version
v15.8.0

Solved, I purge with apt grunt and node-grunt-cli, then I installed grunt-cli with -g.

Now result:

(venv) julio@julio-ntb:~/Development/workspace-python/tryton/facturacion/sao$ grunt
Running "default" task

Running "concat:dist" (concat) task

Running "jshint:dist" (jshint) task
>> 1 file lint free.

Running "jshint:grunt" (jshint) task
>> 1 file lint free.

Running "jshint:tests" (jshint) task
>> 1 file lint free.

Running "uglify:dist" (uglify) task
>> 1 file created 983.72 kB → 429.27 kB

Running "less:dev" (less) task
>> 1 stylesheet created.

Running "less:default" (less) task
>> 1 stylesheet created.

Running "po2json:all" (po2json) task
File "locale/bg.json" created.
File "locale/ca.json" created.
File "locale/cs.json" created.
File "locale/de.json" created.
File "locale/es_419.json" created.
File "locale/es.json" created.
File "locale/et.json" created.
File "locale/fa.json" created.
File "locale/fi.json" created.
File "locale/fr.json" created.
File "locale/hu.json" created.
File "locale/id.json" created.
File "locale/it.json" created.
File "locale/lo.json" created.
File "locale/lt.json" created.
File "locale/nl.json" created.
File "locale/pl.json" created.
File "locale/pt.json" created.
File "locale/ru.json" created.
File "locale/sl.json" created.
File "locale/tr.json" created.
File "locale/zh_CN.json" created.

Done.

But with this the web client was deployed? On browser shows 405 Method not allowed with this url http://localhost:8000/

You are missing the [web] section on trytond.conf you should target the Sao installation path on that section:

Look: Tryton configuration file for sao

I already added it

[web]
listen = 0.0.0.0:8000
root = /home/julio/www

I saw folders created into www

image

WORKED. My bad, root has to point sao folder, thanks German
Now:

[web]
listen = 0.0.0.0:8000
root = sao