QGIS Server – How to Fix Start Error on QWC2

qgisqgis-serverqwc2

I have followed the instructions in https://github.com/qgis/qwc2-demo-app/blob/master/doc/QWC2_Documentation.md#quick-start

When try >>yarn start I get an error on ELIFECYCLE as below

I have looked at the suggested help on yarnpkg but I can't find anything useful. Is there an issue with the current git repo for this project?

Receiving objects: 100% (17408/17408), 3.73 MiB | 7.01 MiB/s, done.
Resolving deltas: 100% (13144/13144), done.
Submodule path 'qwc2': checked out '4fbe944a1028c8bc7d691592a437fcb05ab45725'
root@vmi741672:~/qwc2-demo-app# yarn install
yarn install v1.22.17
[1/4] Resolving packages...
success Already up-to-date.
Done in 0.83s.
root@vmi741672:~/qwc2-demo-app# yarn start
yarn run v1.22.17
$ npm run tsupdate && npm run themesconfig && npm run iconfont && webpack serve --mode development --progress --host 0.0.0.0 --port 8081

> [email protected] tsupdate /root/qwc2-demo-app
> node qwc2/scripts/updateTranslations.js

Generating translations for qwc2
/root/qwc2-demo-app/qwc2/scripts/updateTranslations.js:74
        for (const match of data.matchAll(trRegEx)) {
                                 ^

TypeError: data.matchAll(...) is not a function or its return value is not iterable
    at updateTsConfig (/root/qwc2-demo-app/qwc2/scripts/updateTranslations.js:74:34)
    at Object.<anonymous> (/root/qwc2-demo-app/qwc2/scripts/updateTranslations.js:96:23)
    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 Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] tsupdate: `node qwc2/scripts/updateTranslations.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] tsupdate script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-02-17T13_54_07_210Z-debug.log
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
root@vmi741672:~/qwc2-demo-app# ^C
root@vmi741672:~/qwc2-demo-app# 

I am using
Linux 5.4.0-62-generic x86_64 on Ubuntu 20.04.3 LTS

Best Answer

I was able to fix this issue using https://stackoverflow.com/questions/67105067/error-during-migration-from-npm-to-yarn-the-engine-node-is-incompatible-with

The error that was actually a problem was The engine "node" is incompatible with this module. Expected version ">= 12.13.0". Got "10.19.0"

Related Question