Flywaydb node issue request for assistance
I've updated from node v.16 to v.18 and keep getting flywaydb error messages (see below). Can someone assist please?
node:events:495
npm ERR! throw er; // Unhandled 'error' event
DOWNLOADING https://repo1.maven.org/maven2/org/flywaydb/flyway-commandline/maven-metadata.xml
DOWNLOADING https://repo1.maven.org/maven2/org/flywaydb/flyway-commandline/9.22.3/flyway-commandline-9.22.3-linux-x64.tar.gz
node:events:495
throw er; // Unhandled 'error' event
^
Error: spawn tar ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:284:19)
at onErrorNT (node:internal/child_process:477:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
at ChildProcess._handle.onexit (node:internal/child_process:290:12)
at onErrorNT (node:internal/child_process:477:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn tar',
path: 'tar',
spawnargs: [
'zxf',
'/home/node/app/node_modules/node-flywaydb/jlib/flyway-commandline-9.22.3-linux-x64.tar.gz'
]
}
Best Answer
-
Jon_Kirkwood Posts: 395 Silver 5
Hi @Flyway14bis
Thanks for reaching out on the Redgate forums and sorry to see this issue in updating your Flyway versions.
Looking at the error you've provided, it appears that your pipeline is having issues accessing tar to open the flyway .tar.gz file.
Are you able to confirm that you have tar installed in your environment and that your PATH includes the location of tar so it can be executed.
It may also be an access issue on the downloaded file not being able to be opened/processed by tar.
This may be file access rights or the rights of the user running the pipeline.
Depending on environment there may be different methods to get this resolved, but I would suggest the following
Ensure tar is installed:
<p><i>sudo apt-get update </i></p><p><i>sudo apt-get install tar</i></p>
Check tar is installed in your PATH:
echo $PATH
If it isn't, add it in using
export PATH=$PATH:<u>/path/to/tar</u>
(changing this to actual path to tar)It may also be recommended to update your repo link from Maven to the following to see if it helps resolve this error.
https://download.red-gate.com/maven/release/org/flywaydb/enterprise/flyway-commandline/
https://download.red-gate.com/maven/release/com/redgate/flyway/flyway-commandline/
Jon Kirkwood | Technical Support Engineer | Redgate Software
Answers
Thank you for your swift and kind reply!
I upgraded to node v.18.19, which has tar, and that worked.
Thanks so much again and have a nice day!