Hi everyone
I am trying to export data to dhis2 with openFN jobs. But I am getting an error. Is there anyone who can help me please?
Here is the command I tried to run and its response.
tsegay@tsegay-ThinkPad-L540:~/openfncodes$ openfn exportPecients.js -i -a dhis2 -s dhis22.json -o dhis2output.json --no-strict-output
[CLI] Installing packages…
[CLI] Installation complete in 3.718s
[CLI] Loaded state from dhis22.json
[CLI] ✘ Failed to load adaptor typedefs from path /tmp/openfn/repo/node_modules/@openfn/language-dhis2_3.2.8
[CLI] ✘ Error: ENOENT: no such file or directory, open ‘/tmp/openfn/repo/node_modules/@openfn/language-dhis2_3.2.8/package.json’
[CLI] Compiled job from exportPecients.js
node:internal/process/promises:288
triggerUncaughtException(err, true /* fromPromise */);
^
[Error: ENOENT: no such file or directory, open ‘/tmp/openfn/repo/node_modules/@openfn/language-dhis2_3.2.8/package.json’] {
errno: -2,
code: ‘ENOENT’,
syscall: ‘open’,
path: ‘/tmp/openfn/repo/node_modules/@openfn/language-dhis2_3.2.8/package.json’
}
Hello @tsegayesemere! In your CLI command can you please try -ia dhis2 (where the i and a are together)? Currently you have the -i and -a separately like this: -i -a dhis2
Typically you want to use one or the other (e.g., -i dhis2 or -a dhis2)…
OR both together (e.g., -ia dhis2). See here for the related OpenFn Docs page on the OpenFn CLI key usage commands.
If you’re still having issues, please paste the error in this thread and @mtuchi can respond tomorrow morning EAT
glad you’re all sorted out @tsegayesemere , but wow… 19 minutes is a long time. they’re usually very quick, so I’d say if something is taking more than a few seconds it’s worth checking https://status.npmjs.org/
while the adaptor itself is small the dependency installation might take a while if NPMjs is having trouble.
thanks so much for reporting and please let us know if this problem pops back up again. use @jclark 's command (--log debug) so we can get a little more detail and let us know what OS and node version you’re using.
Installation time reduced significantly when I run it for a second time. Here is the log detail.
tsegay@tsegay-ThinkPad-L540:~/openfncodes$ openfn exportPatients.js -ia dhis2 -s dhis22.json -o test.json --no-strict-output --log debug
[CLI] Versions:
▸ node.js 18.15.0
▸ cli 0.0.34
▸ runtime 0.0.21
▸ compiler 0.0.28
▸ @openfn/language-dhis2 latest
[CLI] Auto-installing language adaptors
[CLI] Installing packages…
[CLI] ❯ repoDir is set to: /tmp/openfn/repo
[CLI] Looked up latest version of @openfn/language-dhis2: found 3.2.8
[CLI] ❯ Using latest installed version of @openfn/language-dhis2: 3.2.8
[CLI] Skipping @openfn/language-dhis2@3.2.8 as already installed
[CLI] Installation complete in 1.437s
[CLI] ❯ Load state…
[CLI] Loaded state from dhis22.json
[CLI] ❯ state: {“configuration”:{“hostUrl”:““,“username”:””,“password”:“****”},“pdata”:[{“id”:1,“name”:“Leanne Graham”,“username”:“Bret”,“email”:“Sincere@april.biz”,“address”:{“street”:“Kulas Light”,“suite”:“Apt. 556”,“city”:“Gwenborough”,“zipcode”:“92998-3874”,“geo”:{“lat”:“-37.3159”,“lng”:“81.1496”}},“phone”:“1-770-736-8031 x56442”,“website”:“hildegard.org”,“company”:{“name”:“Romaguera-Crona”,“catchPhrase”:“Multi-layered client-server neural-net”,“bs”:“harness real-time e-markets”}},