Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expecting only one executable Flyway CLI to be found. Instead found multiple executable files: flyway.cmd,README.txt,flyway #23

Open
kishaningithub opened this issue Feb 4, 2024 · 3 comments

Comments

@kishaningithub
Copy link

My DB migration script failed with the following error

$ bun run ./migrate.ts

50 |             throw new Error(`Unable to find an executable Flyway CLI in target directory: ${directory}`);
51 |         }
52 |         if (executableFiles.length > 1) {
53 |             const executableFilesWithCorrectName = executableFiles.filter(file => file.name.includes("flyway"));
54 |             if (executableFilesWithCorrectName.length > 1) {
55 |                 throw new Error(`Expecting only one executable Flyway CLI to be found. Instead found multiple executable files: ${executableFiles.map(ex => ex.name)}`);
                           ^
error: Expecting only one executable Flyway CLI to be found. Instead found multiple executable files: flyway.cmd,README.txt,flyway
      at ./node_modules/node-flyway/dist/cli/service/flyway-cli-service.js:55:23
error: script "db:migrate" exited with code 1

Migration file

This migration file is just a copy paste of the example

import { Flyway } from "node-flyway";

const flyway = new Flyway(
    {
        url:"jdbc:postgresql://localhost:5432/postgres",
        user:"postgres",
        password:"password",
        defaultSchema: "public",
        migrationLocations: ["migrations"]
    }
);

flyway.migrate().then(response => {
    if(!response.success) {
        throw new Error(`Unable to execute migrate command. Error: ${response.error?.errorCode}`);
    }
    console.log(`Migrations are successful ${response}`);
});
@domdinnes
Copy link
Owner

Hey @kishaningithub. Thanks for raising this. Which OS are you using?

@kishaningithub
Copy link
Author

OS: Mac OS X (Mac book pro)
Chip: M1
Architecture: Arm 64

@ScottPierce
Copy link

ScottPierce commented Sep 2, 2024

@domdinnes I'm also seeing this, on my M1 Mac.

error: Expecting only one executable Flyway CLI to be found. Instead found multiple executable files: flyway.cmd,README.txt,flyway
pwd
/Users/scottpierce/.node-flyway/flyway-9.0.0
ls -a 
.		conf		flyway.cmd	lib
..		drivers		jars		licenses
README.txt	flyway		jre		sql

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants