I wanted to work with the actualbudget api and encountered the following error when running my script:

$ node smokeTest.js
Error updating Error: out-of-sync-migrations
    at checkDatabaseValidity (/api/node_modules/@actual-app/api/app/bundle.api.js:61515:13)
    at Module.migrate (/api/node_modules/@actual-app/api/app/bundle.api.js:61522:3)
    at async runMigrations (/api/node_modules/@actual-app/api/app/bundle.api.js:66452:3)
    at async updateVersion (/api/node_modules/@actual-app/api/app/bundle.api.js:66468:3)
    at async loadBudget (/api/node_modules/@actual-app/api/app/bundle.api.js:61104:5)
[...]

I had encountered this error before and was due to the @actual-app/api node package to be outdated.

View the package version installed on your computer (5.1.2 in that case):

$ npm list @actual-app/api
user@ /home/alex/my-app
├── @actual-app/api@5.1.2

View the latest package available in the registry (6.6.0 in that case):

$ npm view @actual-app/api

@actual-app/api@6.6.0 | MIT | deps: 4 | versions: 37
An API for Actual

dist
.tarball: https://registry.npmjs.org/@actual-app/api/-/api-6.6.0.tgz
.shasum: 8ece3aed714e81a838b41b489b9c02756cddf3e3
.integrity: sha512-PR+mnau9OZSPltHSTuUBT8T+sxpb3IHKIBm5wfc/xxsl/4VPP95Z0obNNrSak/hWLqe+YMyILcHfhz2KiiGxDg==
.unpackedSize: 3.7 MB

dependencies:
better-sqlite3: ^9.3.0   compare-versions: ^6.1.0 node-fetch: ^3.3.2       uuid: ^9.0.1

maintainers:
- matissjanis <npmjs.org@mja.lv>
- actual-app-user <help@actualbudget.com>

dist-tags:
latest: 6.6.0

published 3 weeks ago by matissjanis <npmjs.org@mja.lv>

Clearly, my local version needs updated, so let’s do the following:

$ npm update @actual-app/api

# Confirm your local version
$ npm list @actual-app/api
user@ /home/alex/my-app
├── @actual-app/api@6.6.0

My script ran fine after this update.