Search code examples
dockerosrm

Running osrm-frontend docker failing due to syntax error in Micromatch


Firstly, I ran the osrm-backend docker successfully. I validated its result with a few queries. Then, I tried to run the osrm-frontend docker using the steps provided in its repo. However, it fails due to a syntax error in Micromatch. the error is as follows:

/src/node_modules/micromatch/index.js:44
    let isMatch = picomatch(String(patterns[i]), { ...options, onResult }, true);
                                                   ^^^


SyntaxError: Unexpected token ...
at Object.exports.runInThisContext (vm.js:76:16)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/src/node_modules/budo/lib/budo.js:6:15)
at Module._compile (module.js:570:32)

How can I fix it?


Solution

  • The dockerfile has a low alpine version (3.5) and therefore installs a low nodejs version (6.19). changing the alpine version from 3.5 to 3.15 fixed the issue.