I would like to run Renovate locally, like described in the docs.
I can run the following test project with the 2 files (package.json and renovate.json) without any problems using the Mend-hosted app (GitHub App Renovate Bot).
But when I try to run it locally from within the repository using
LOG_LEVEL=debug npx renovate --platform=local --repository-cache=reset
I get the following error. I have npm installed using the apt
package manager.
/home/$USER/.npm/_npx/05eeecd92f4e18e0/node_modules/renovate/dist/instrumentation/index.js:33
[semantic_conventions_1.ATTR_SERVICE_NAME]: process.env.OTEL_SERVICE_NAME ?? 'renovate',
^
SyntaxError: Unexpected token '?'
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:85:18)
at Object.<anonymous> (/home/gautam/.npm/_npx/05eeecd92f4e18e0/node_modules/renovate/lib/renovate.ts:4:1)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
package.json:
{
"devDependencies": {
"chalk": "5.2.0"
}
}
renovate.json
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended"
]
}
As @Harsh-Manvar mentioned the problem lied in the old version of node installed using apt on Ubuntu 22.04. I installed a more up to date version, specifically v20.18.0, and it worked.