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

Migration command fails (nx migrate --run-migrations=migrations.json) #29146

Open
1 of 4 tasks
Jcomper opened this issue Dec 2, 2024 · 2 comments
Open
1 of 4 tasks

Migration command fails (nx migrate --run-migrations=migrations.json) #29146

Jcomper opened this issue Dec 2, 2024 · 2 comments

Comments

@Jcomper
Copy link
Contributor

Jcomper commented Dec 2, 2024

Current Behavior

When running
nx migrate --run-migrations=migrations.json --verbose
I'm getting the following errors:

`
NX Running 'npm install' to make sure necessary packages are installed

up to date, audited 1697 packages in 3s

234 packages are looking for funding
run npm fund for details

found 0 vulnerabilities
'nx' is not recognized as an internal or external command,
operable program or batch file.
nx migrate [packageAndVersion]

Creates a migrations file or runs migrations from the migrations file.

  • Migrate packages and create migrations.json (e.g., nx migrate @nx/workspace@latest)
  • Run migrations (e.g., nx migrate --run-migrations=migrations.json). Use flag --if-exists to run migrations only if the migrations file exists.

Positionals:
packageAndVersion The target package and version (e.g, @nx/[email protected]). [string]
Options:
--help Show help [boolean]
--version Show version number [boolean]
--verbose Prints additional information about the commands (e.g., stack traces). [boolean]
--runMigrations Execute migrations from a file (when the file isn't provided, execute migrations from migrations.json). [string]
--ifExists Run migrations only if the migrations file exists, if not continues successfully. [boolean] [default: false]
--from Use the provided versions for packages instead of the ones installed in node_modules (e.g., --from="@nx/[email protected],@nx/[email protected]"). [string]
--to Use the provided versions for packages instead of the ones calculated by the migrator (e.g., --to="@nx/[email protected],@nx/[email protected]"). [string]
-C, --createCommits Automatically create a git commit after each migration runs. [boolean] [default: false]
--commitPrefix Commit prefix to apply to the commit for each migration, when --create-commits is enabled. [string] [default: "chore: [nx migration] "]
--interactive Enable prompts to confirm whether to collect optional package updates and migrations. [boolean] [default: false]
--excludeAppliedMigrations Exclude migrations that should have been applied on previous updates. To be used with --from. [boolean] [default: false]
Examples:
migrate latest Update all Nx plugins to "latest". This will generate migrations.json
migrate 9.0.0 Update all Nx plugins to "9.0.0". This will generate migrations.json
migrate @nx/[email protected] --from="@nx/[email protected],@nx/[email protected]" Update @nx/workspace and generate the list of migrations starting with version 8.0.0 of @nx/workspace and @nx/node,
regardless of what is installed locally
migrate @nx/[email protected] --to="@nx/[email protected],@nx/[email protected]" Update @nx/workspace to "9.0.0". If it tries to update @nx/react or @nx/angular, use version "9.0.1"
migrate [email protected] Update another-package to "12.0.0". This will update other packages and will generate migrations.json file
migrate latest --interactive Collect package updates and migrations in interactive mode. In this mode, the user will be prompted whether to
apply any optional package update and migration
migrate latest [email protected] --exclude-applied-migrations Collect package updates and migrations starting with version 14.5.0 of "nx" (and Nx first-party plugins),
regardless of what is installed locally, while excluding migrations that should have been applied on previous
updates
migrate --run-migrations=migrations.json Run migrations from the provided migrations.json file. You can modify migrations.json and run this command many
times
migrate --run-migrations --create-commits Create a dedicated commit for each successfully completed migration. You can customize the prefix used for each
commit by additionally setting --commit-prefix="PREFIX_HERE "

Find more information and examples at https://nx.dev/nx/migrate

Error: Command failed: npx nx _migrate --run-migrations=migrations.json --verbose
at genericNodeError (node:internal/errors:983:15)
at wrappedFn (node:internal/errors:537:14)
at checkExecSyncError (node:child_process:888:11)
at execSync (node:child_process:960:15)
at runNxSync (C:\Users\Jcomp\source\repos\ecm\master\web\frontend\node_modules\nx\src\utils\child-process.js:28:34)
at runLocalMigrate (C:\Users\Jcomp\source\repos\ecm\master\web\frontend\node_modules\nx\src\command-line\migrate\migrate.js:1057:39)
at Object.runMigration (C:\Users\Jcomp\source\repos\ecm\master\web\frontend\node_modules\nx\src\command-line\migrate\migrate.js:1080:9)
at Object.handler (C:\Users\Jcomp\source\repos\ecm\master\web\frontend\node_modules\nx\src\command-line\migrate\command-object.js:13:68) {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 6804,
stdout: null,
stderr: null
}

NX Command failed: npx nx migrate --run-migrations=migrations.json --verbose

Error: Command failed: npx nx migrate --run-migrations=migrations.json --verbose
at genericNodeError (node:internal/errors:983:15)
at wrappedFn (node:internal/errors:537:14)
at checkExecSyncError (node:child_process:888:11)
at execSync (node:child_process:960:15)
at runNxSync (C:\Users\Jcomp\source\repos\ecm\master\Web\frontend\node_modules\nx\src\utils\child-process.js:28:34)
at runMigrations (C:\Users\Jcomp\source\repos\ecm\master\Web\frontend\node_modules\nx\src\command-line\migrate\migrate.js:985:39)
at C:\Users\Jcomp\source\repos\ecm\master\Web\frontend\node_modules\nx\src\command-line\migrate\migrate.js:1051:19
at async handleErrors (C:\Users\Jcomp\source\repos\ecm\master\Web\frontend\node_modules\nx\src\utils\handle-errors.js:8:24)

nx migrate [packageAndVersion]

Creates a migrations file or runs migrations from the migrations file.

  • Migrate packages and create migrations.json (e.g., nx migrate @nx/workspace@latest)
  • Run migrations (e.g., nx migrate --run-migrations=migrations.json). Use flag --if-exists to run migrations only if the migrations file exists.

Positionals:
packageAndVersion The target package and version (e.g, @nx/[email protected]). [string]

Options:
--help Show help [boolean]
--version Show version number [boolean]
--verbose Prints additional information about the commands (e.g., stack traces). [boolean]
--runMigrations Execute migrations from a file (when the file isn't provided, execute migrations from migrations.json). [string]
--ifExists Run migrations only if the migrations file exists, if not continues successfully. [boolean] [default: false]
--from Use the provided versions for packages instead of the ones installed in node_modules (e.g., --from="@nx/[email protected],@nx/[email protected]"). [string]
--to Use the provided versions for packages instead of the ones calculated by the migrator (e.g., --to="@nx/[email protected],@nx/[email protected]"). [string]
-C, --createCommits Automatically create a git commit after each migration runs. [boolean] [default: false]
--commitPrefix Commit prefix to apply to the commit for each migration, when --create-commits is enabled. [string] [default: "chore: [nx migration] "]
--interactive Enable prompts to confirm whether to collect optional package updates and migrations. [boolean] [default: false]
--excludeAppliedMigrations Exclude migrations that should have been applied on previous updates. To be used with --from. [boolean] [default: false]

Examples:
migrate latest Update all Nx plugins to "latest". This will generate migrations.json
migrate 9.0.0 Update all Nx plugins to "9.0.0". This will generate migrations.json
migrate @nx/[email protected] --from="@nx/[email protected],@nx/[email protected]" Update @nx/workspace and generate the list of migrations starting with version 8.0.0 of @nx/workspace and @nx/node,
regardless of what is installed locally
migrate @nx/[email protected] --to="@nx/[email protected],@nx/[email protected]" Update @nx/workspace to "9.0.0". If it tries to update @nx/react or @nx/angular, use version "9.0.1"
migrate [email protected] Update another-package to "12.0.0". This will update other packages and will generate migrations.json file
migrate latest --interactive Collect package updates and migrations in interactive mode. In this mode, the user will be prompted whether to
apply any optional package update and migration
migrate latest [email protected] --exclude-applied-migrations Collect package updates and migrations starting with version 14.5.0 of "nx" (and Nx first-party plugins),
regardless of what is installed locally, while excluding migrations that should have been applied on previous
updates
migrate --run-migrations=migrations.json Run migrations from the provided migrations.json file. You can modify migrations.json and run this command many
times
migrate --run-migrations --create-commits Create a dedicated commit for each successfully completed migration. You can customize the prefix used for each
commit by additionally setting --commit-prefix="PREFIX_HERE "

Find more information and examples at https://nx.dev/nx/migrate

Error: Command failed: npx nx _migrate --run-migrations=migrations.json --verbose
at genericNodeError (node:internal/errors:983:15)
at wrappedFn (node:internal/errors:537:14)
at checkExecSyncError (node:child_process:888:11)
at execSync (node:child_process:960:15)
at runNxSync (C:\Users\Jcomp\source\repos\ecm\master\web\frontend\node_modules\nx\src\utils\child-process.js:28:34)
at runLocalMigrate (C:\Users\Jcomp\source\repos\ecm\master\web\frontend\node_modules\nx\src\command-line\migrate\migrate.js:1057:39)
at Object.runMigration (C:\Users\Jcomp\source\repos\ecm\master\web\frontend\node_modules\nx\src\command-line\migrate\migrate.js:1080:9)
at Object.handler (C:\Users\Jcomp\source\repos\ecm\master\web\frontend\node_modules\nx\src\command-line\migrate\command-object.js:13:68) {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 22920,
stdout: null,
stderr: null
}

NX Command failed: npx nx migrate --run-migrations=migrations.json --verbose

Error: Command failed: npx nx migrate --run-migrations=migrations.json --verbose
at genericNodeError (node:internal/errors:983:15)
at wrappedFn (node:internal/errors:537:14)
at checkExecSyncError (node:child_process:888:11)
at execSync (node:child_process:960:15)
at runNxSync (C:\Users\Jcomp\source\repos\ecm\master\Web\frontend\node_modules\nx\src\utils\child-process.js:28:34)
at runMigrations (C:\Users\Jcomp\source\repos\ecm\master\Web\frontend\node_modules\nx\src\command-line\migrate\migrate.js:985:39)
at C:\Users\Jcomp\source\repos\ecm\master\Web\frontend\node_modules\nx\src\command-line\migrate\migrate.js:1051:19
at async handleErrors (C:\Users\Jcomp\source\repos\ecm\master\Web\frontend\node_modules\nx\src\utils\handle-errors.js:8:24)

nx migrate [packageAndVersion]

Creates a migrations file or runs migrations from the migrations file.

  • Migrate packages and create migrations.json (e.g., nx migrate @nx/workspace@latest)
  • Run migrations (e.g., nx migrate --run-migrations=migrations.json). Use flag --if-exists to run migrations only if the migrations file exists.

Positionals:
packageAndVersion The target package and version (e.g, @nx/[email protected]). [string]

Options:
--help Show help [boolean]
--version Show version number [boolean]
--verbose Prints additional information about the commands (e.g., stack traces). [boolean]
--runMigrations Execute migrations from a file (when the file isn't provided, execute migrations from migrations.json). [string]
--ifExists Run migrations only if the migrations file exists, if not continues successfully. [boolean] [default: false]
--from Use the provided versions for packages instead of the ones installed in node_modules (e.g., --from="@nx/[email protected],@nx/[email protected]"). [string]
--to Use the provided versions for packages instead of the ones calculated by the migrator (e.g., --to="@nx/[email protected],@nx/[email protected]"). [string]
-C, --createCommits Automatically create a git commit after each migration runs. [boolean] [default: false]
--commitPrefix Commit prefix to apply to the commit for each migration, when --create-commits is enabled. [string] [default: "chore: [nx migration] "]
--interactive Enable prompts to confirm whether to collect optional package updates and migrations. [boolean] [default: false]
--excludeAppliedMigrations Exclude migrations that should have been applied on previous updates. To be used with --from. [boolean] [default: false]

Examples:
migrate latest Update all Nx plugins to "latest". This will generate migrations.json
migrate 9.0.0 Update all Nx plugins to "9.0.0". This will generate migrations.json
migrate @nx/[email protected] --from="@nx/[email protected],@nx/[email protected]" Update @nx/workspace and generate the list of migrations starting with version 8.0.0 of @nx/workspace and @nx/node,
regardless of what is installed locally
migrate @nx/[email protected] --to="@nx/[email protected],@nx/[email protected]" Update @nx/workspace to "9.0.0". If it tries to update @nx/react or @nx/angular, use version "9.0.1"
migrate [email protected] Update another-package to "12.0.0". This will update other packages and will generate migrations.json file
migrate latest --interactive Collect package updates and migrations in interactive mode. In this mode, the user will be prompted whether to
apply any optional package update and migration
migrate latest [email protected] --exclude-applied-migrations Collect package updates and migrations starting with version 14.5.0 of "nx" (and Nx first-party plugins),
regardless of what is installed locally, while excluding migrations that should have been applied on previous
updates
migrate --run-migrations=migrations.json Run migrations from the provided migrations.json file. You can modify migrations.json and run this command many
times
migrate --run-migrations --create-commits Create a dedicated commit for each successfully completed migration. You can customize the prefix used for each
commit by additionally setting --commit-prefix="PREFIX_HERE "

Find more information and examples at https://nx.dev/nx/migrate

Error: Command failed: npx nx _migrate --run-migrations=migrations.json --verbose
at genericNodeError (node:internal/errors:983:15)
at wrappedFn (node:internal/errors:537:14)
at checkExecSyncError (node:child_process:888:11)
at execSync (node:child_process:960:15)
at runNxSync (C:\Users\Jcomp\source\repos\ecm\master\web\frontend\node_modules\nx\src\utils\child-process.js:28:34)
at runLocalMigrate (C:\Users\Jcomp\source\repos\ecm\master\web\frontend\node_modules\nx\src\command-line\migrate\migrate.js:1057:39)
at Object.runMigration (C:\Users\Jcomp\source\repos\ecm\master\web\frontend\node_modules\nx\src\command-line\migrate\migrate.js:1080:9)
at Object.handler (C:\Users\Jcomp\source\repos\ecm\master\web\frontend\node_modules\nx\src\command-line\migrate\command-object.js:13:68) {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 15028,
stdout: null,
stderr: null
}

NX Command failed: npx nx migrate --run-migrations=migrations.json --verbose

Error: Command failed: npx nx migrate --run-migrations=migrations.json --verbose
at genericNodeError (node:internal/errors:983:15)
at wrappedFn (node:internal/errors:537:14)
at checkExecSyncError (node:child_process:888:11)
at execSync (node:child_process:960:15)
at runNxSync (C:\Users\Jcomp\source\repos\ecm\master\Web\frontend\node_modules\nx\src\utils\child-process.js:28:34)
at runMigrations (C:\Users\Jcomp\source\repos\ecm\master\Web\frontend\node_modules\nx\src\command-line\migrate\migrate.js:985:39)
at C:\Users\Jcomp\source\repos\ecm\master\Web\frontend\node_modules\nx\src\command-line\migrate\migrate.js:1051:19
at async handleErrors (C:\Users\Jcomp\source\repos\ecm\master\Web\frontend\node_modules\nx\src\utils\handle-errors.js:8:24)

nx migrate [packageAndVersion]

Creates a migrations file or runs migrations from the migrations file.

  • Migrate packages and create migrations.json (e.g., nx migrate @nx/workspace@latest)
  • Run migrations (e.g., nx migrate --run-migrations=migrations.json). Use flag --if-exists to run migrations only if the migrations file exists.

Positionals:
packageAndVersion The target package and version (e.g, @nx/[email protected]). [string]

Options:
--help Show help [boolean]
--version Show version number [boolean]
--verbose Prints additional information about the commands (e.g., stack traces). [boolean]
--runMigrations Execute migrations from a file (when the file isn't provided, execute migrations from migrations.json). [string]
--ifExists Run migrations only if the migrations file exists, if not continues successfully. [boolean] [default: false]
--from Use the provided versions for packages instead of the ones installed in node_modules (e.g., --from="@nx/[email protected],@nx/[email protected]"). [string]
--to Use the provided versions for packages instead of the ones calculated by the migrator (e.g., --to="@nx/[email protected],@nx/[email protected]"). [string]
-C, --createCommits Automatically create a git commit after each migration runs. [boolean] [default: false]
--commitPrefix Commit prefix to apply to the commit for each migration, when --create-commits is enabled. [string] [default: "chore: [nx migration] "]
--interactive Enable prompts to confirm whether to collect optional package updates and migrations. [boolean] [default: false]
--excludeAppliedMigrations Exclude migrations that should have been applied on previous updates. To be used with --from. [boolean] [default: false]

Examples:
migrate latest Update all Nx plugins to "latest". This will generate migrations.json
migrate 9.0.0 Update all Nx plugins to "9.0.0". This will generate migrations.json
migrate @nx/[email protected] --from="@nx/[email protected],@nx/[email protected]" Update @nx/workspace and generate the list of migrations starting with version 8.0.0 of @nx/workspace and @nx/node,
regardless of what is installed locally
migrate @nx/[email protected] --to="@nx/[email protected],@nx/[email protected]" Update @nx/workspace to "9.0.0". If it tries to update @nx/react or @nx/angular, use version "9.0.1"
migrate [email protected] Update another-package to "12.0.0". This will update other packages and will generate migrations.json file
migrate latest --interactive Collect package updates and migrations in interactive mode. In this mode, the user will be prompted whether to
apply any optional package update and migration
migrate latest [email protected] --exclude-applied-migrations Collect package updates and migrations starting with version 14.5.0 of "nx" (and Nx first-party plugins),
regardless of what is installed locally, while excluding migrations that should have been applied on previous
updates
migrate --run-migrations=migrations.json Run migrations from the provided migrations.json file. You can modify migrations.json and run this command many
times
migrate --run-migrations --create-commits Create a dedicated commit for each successfully completed migration. You can customize the prefix used for each
commit by additionally setting --commit-prefix="PREFIX_HERE "

Find more information and examples at https://nx.dev/nx/migrate

Error: Command failed: npx nx _migrate --run-migrations=migrations.json --verbose
at genericNodeError (node:internal/errors:983:15)
at wrappedFn (node:internal/errors:537:14)
at checkExecSyncError (node:child_process:888:11)
at execSync (node:child_process:960:15)
at runNxSync (C:\Users\Jcomp\source\repos\ecm\master\web\frontend\node_modules\nx\src\utils\child-process.js:28:34)
at runLocalMigrate (C:\Users\Jcomp\source\repos\ecm\master\web\frontend\node_modules\nx\src\command-line\migrate\migrate.js:1057:39)
at Object.runMigration (C:\Users\Jcomp\source\repos\ecm\master\web\frontend\node_modules\nx\src\command-line\migrate\migrate.js:1080:9)
at Object.handler (C:\Users\Jcomp\source\repos\ecm\master\web\frontend\node_modules\nx\src\command-line\migrate\command-object.js:13:68) {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 36860,
stdout: null,
stderr: null
}

NX Command failed: npx nx migrate --run-migrations=migrations.json --verbose

Error: Command failed: npx nx migrate --run-migrations=migrations.json --verbose
at genericNodeError (node:internal/errors:983:15)
at wrappedFn (node:internal/errors:537:14)
at checkExecSyncError (node:child_process:888:11)
at execSync (node:child_process:960:15)
at runNxSync (C:\Users\Jcomp\source\repos\ecm\master\Web\frontend\node_modules\nx\src\utils\child-process.js:28:34)
at runMigrations (C:\Users\Jcomp\source\repos\ecm\master\Web\frontend\node_modules\nx\src\command-line\migrate\migrate.js:985:39)
at C:\Users\Jcomp\source\repos\ecm\master\Web\frontend\node_modules\nx\src\command-line\migrate\migrate.js:1051:19
at async handleErrors (C:\Users\Jcomp\source\repos\ecm\master\Web\frontend\node_modules\nx\src\utils\handle-errors.js:8:24)

nx migrate [packageAndVersion]

Creates a migrations file or runs migrations from the migrations file.

  • Migrate packages and create migrations.json (e.g., nx migrate @nx/workspace@latest)
  • Run migrations (e.g., nx migrate --run-migrations=migrations.json). Use flag --if-exists to run migrations only if the migrations file exists.

Positionals:
packageAndVersion The target package and version (e.g, @nx/[email protected]). [string]

Options:
--help Show help [boolean]
--version Show version number [boolean]
--verbose Prints additional information about the commands (e.g., stack traces). [boolean]
--runMigrations Execute migrations from a file (when the file isn't provided, execute migrations from migrations.json). [string]
--ifExists Run migrations only if the migrations file exists, if not continues successfully. [boolean] [default: false]
--from Use the provided versions for packages instead of the ones installed in node_modules (e.g., --from="@nx/[email protected],@nx/[email protected]"). [string]
--to Use the provided versions for packages instead of the ones calculated by the migrator (e.g., --to="@nx/[email protected],@nx/[email protected]"). [string]
-C, --createCommits Automatically create a git commit after each migration runs. [boolean] [default: false]
--commitPrefix Commit prefix to apply to the commit for each migration, when --create-commits is enabled. [string] [default: "chore: [nx migration] "]
--interactive Enable prompts to confirm whether to collect optional package updates and migrations. [boolean] [default: false]
--excludeAppliedMigrations Exclude migrations that should have been applied on previous updates. To be used with --from. [boolean] [default: false]

Examples:
migrate latest Update all Nx plugins to "latest". This will generate migrations.json
migrate 9.0.0 Update all Nx plugins to "9.0.0". This will generate migrations.json
migrate @nx/[email protected] --from="@nx/[email protected],@nx/[email protected]" Update @nx/workspace and generate the list of migrations starting with version 8.0.0 of @nx/workspace and @nx/node,
regardless of what is installed locally
migrate @nx/[email protected] --to="@nx/[email protected],@nx/[email protected]" Update @nx/workspace to "9.0.0". If it tries to update @nx/react or @nx/angular, use version "9.0.1"
migrate [email protected] Update another-package to "12.0.0". This will update other packages and will generate migrations.json file
migrate latest --interactive Collect package updates and migrations in interactive mode. In this mode, the user will be prompted whether to
apply any optional package update and migration
migrate latest [email protected] --exclude-applied-migrations Collect package updates and migrations starting with version 14.5.0 of "nx" (and Nx first-party plugins),
regardless of what is installed locally, while excluding migrations that should have been applied on previous
updates
migrate --run-migrations=migrations.json Run migrations from the provided migrations.json file. You can modify migrations.json and run this command many
times
migrate --run-migrations --create-commits Create a dedicated commit for each successfully completed migration. You can customize the prefix used for each
commit by additionally setting --commit-prefix="PREFIX_HERE "

Find more information and examples at https://nx.dev/nx/migrate

Error: Command failed: npx nx _migrate --run-migrations=migrations.json --verbose
at genericNodeError (node:internal/errors:983:15)
at wrappedFn (node:internal/errors:537:14)
at checkExecSyncError (node:child_process:888:11)
at execSync (node:child_process:960:15)
at runNxSync (C:\Users\Jcomp\source\repos\ecm\master\web\frontend\node_modules\nx\src\utils\child-process.js:28:34)
at runLocalMigrate (C:\Users\Jcomp\source\repos\ecm\master\web\frontend\node_modules\nx\src\command-line\migrate\migrate.js:1057:39)
at Object.runMigration (C:\Users\Jcomp\source\repos\ecm\master\web\frontend\node_modules\nx\src\command-line\migrate\migrate.js:1080:9)
at Object.handler (C:\Users\Jcomp\source\repos\ecm\master\web\frontend\node_modules\nx\src\command-line\migrate\command-object.js:13:68) {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 34804,
stdout: null,
stderr: null
}

NX Command failed: npx nx migrate --run-migrations=migrations.json --verbose

Error: Command failed: npx nx migrate --run-migrations=migrations.json --verbose
at genericNodeError (node:internal/errors:983:15)
at wrappedFn (node:internal/errors:537:14)
at checkExecSyncError (node:child_process:888:11)
at execSync (node:child_process:960:15)
at runNxSync (C:\Users\Jcomp\AppData\Local\Temp\tmp-35044-IKMqEyNEcIPr\node_modules\nx\src\utils\child-process.js:28:34)
at runMigrations (C:\Users\Jcomp\AppData\Local\Temp\tmp-35044-IKMqEyNEcIPr\node_modules\nx\src\command-line\migrate\migrate.js:985:39)
at C:\Users\Jcomp\AppData\Local\Temp\tmp-35044-IKMqEyNEcIPr\node_modules\nx\src\command-line\migrate\migrate.js:1051:19
at async handleErrors (C:\Users\Jcomp\AppData\Local\Temp\tmp-35044-IKMqEyNEcIPr\node_modules\nx\src\utils\handle-errors.js:8:24)

nx migrate [packageAndVersion]

Creates a migrations file or runs migrations from the migrations file.

  • Migrate packages and create migrations.json (e.g., nx migrate @nx/workspace@latest)
  • Run migrations (e.g., nx migrate --run-migrations=migrations.json). Use flag --if-exists to run migrations only if the migrations file exists.

Positionals:
packageAndVersion The target package and version (e.g, @nx/[email protected]). [string]

Options:
--help Show help [boolean]
--version Show version number [boolean]
--verbose Prints additional information about the commands (e.g., stack traces). [boolean]
--runMigrations Execute migrations from a file (when the file isn't provided, execute migrations from migrations.json). [string]
--ifExists Run migrations only if the migrations file exists, if not continues successfully. [boolean] [default: false]
--from Use the provided versions for packages instead of the ones installed in node_modules (e.g., --from="@nx/[email protected],@nx/[email protected]"). [string]
--to Use the provided versions for packages instead of the ones calculated by the migrator (e.g., --to="@nx/[email protected],@nx/[email protected]"). [string]
-C, --createCommits Automatically create a git commit after each migration runs. [boolean] [default: false]
--commitPrefix Commit prefix to apply to the commit for each migration, when --create-commits is enabled. [string] [default: "chore: [nx migration] "]
--interactive Enable prompts to confirm whether to collect optional package updates and migrations. [boolean] [default: false]
--excludeAppliedMigrations Exclude migrations that should have been applied on previous updates. To be used with --from. [boolean] [default: false]

Examples:
migrate latest Update all Nx plugins to "latest". This will generate migrations.json
migrate 9.0.0 Update all Nx plugins to "9.0.0". This will generate migrations.json
migrate @nx/[email protected] --from="@nx/[email protected],@nx/[email protected]" Update @nx/workspace and generate the list of migrations starting with version 8.0.0 of @nx/workspace and @nx/node,
regardless of what is installed locally
migrate @nx/[email protected] --to="@nx/[email protected],@nx/[email protected]" Update @nx/workspace to "9.0.0". If it tries to update @nx/react or @nx/angular, use version "9.0.1"
migrate [email protected] Update another-package to "12.0.0". This will update other packages and will generate migrations.json file
migrate latest --interactive Collect package updates and migrations in interactive mode. In this mode, the user will be prompted whether to
apply any optional package update and migration
migrate latest [email protected] --exclude-applied-migrations Collect package updates and migrations starting with version 14.5.0 of "nx" (and Nx first-party plugins),
regardless of what is installed locally, while excluding migrations that should have been applied on previous
updates
migrate --run-migrations=migrations.json Run migrations from the provided migrations.json file. You can modify migrations.json and run this command many
times
migrate --run-migrations --create-commits Create a dedicated commit for each successfully completed migration. You can customize the prefix used for each
commit by additionally setting --commit-prefix="PREFIX_HERE "

Find more information and examples at https://nx.dev/nx/migrate

Error: Command failed: C:\Users\Jcomp\AppData\Local\Temp\tmp-35044-IKMqEyNEcIPr\node_modules.bin\nx _migrate --run-migrations=migrations.json --verbose
at genericNodeError (node:internal/errors:983:15)
at wrappedFn (node:internal/errors:537:14)
at checkExecSyncError (node:child_process:888:11)
at execSync (node:child_process:960:15)
at Object.runMigration (C:\Users\Jcomp\source\repos\ecm\master\web\frontend\node_modules\nx\src\command-line\migrate\migrate.js:1073:42)
at Object.handler (C:\Users\Jcomp\source\repos\ecm\master\web\frontend\node_modules\nx\src\command-line\migrate\command-object.js:13:68) {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 32300,
stdout: null,
stderr: null
}`

The strange thing is this one: 'nx' is not recognized as an internal or external command,
operable program or batch file.
how it's possible that 'nx' is not recognized command if I'm running it?

Expected Behavior

I'm expecting to get it to work.

GitHub Repo

No response

Steps to Reproduce

I don't have the exact steps, after updating Angular from 17 -> 18 I just can't run migration.json

Nx Report

NX   Report complete - copy this into the issue template

Node           : 22.11.0
OS             : win32-x64
Native Target  : x86_64-windows
npm            : 10.9.0

nx (global)        : 20.1.4
nx                 : 20.1.4
@nx/js             : 20.1.4
@nx/jest           : 20.1.4
@nx/eslint         : 20.1.4
@nx/workspace      : 20.1.4
@nx/angular        : 20.1.4
@nx/cypress        : 20.1.4
@nx/devkit         : 20.1.4
@nx/eslint-plugin  : 20.1.4
@nx/web            : 20.1.4
@nx/webpack        : 20.1.4
typescript         : 5.4.5
---------------------------------------
Community plugins:
@ng-bootstrap/ng-bootstrap           : 16.0.0
@ngrx/component-store                : 17.0.1
@ngrx/effects                        : 17.0.1
@ngrx/entity                         : 17.0.1
@ngrx/store                          : 17.0.1
@ngrx/store-devtools                 : 17.0.1
@ngx-formly/schematics               : 6.3.11
@progress/kendo-angular-buttons      : 17.0.1
@progress/kendo-angular-dateinputs   : 17.0.1
@progress/kendo-angular-dialog       : 17.0.1
@progress/kendo-angular-dropdowns    : 17.0.1
@progress/kendo-angular-excel-export : 17.0.1
@progress/kendo-angular-grid         : 17.0.1
@progress/kendo-angular-icons        : 17.0.0
@progress/kendo-angular-inputs       : 17.0.1
@progress/kendo-angular-intl         : 17.0.1
@progress/kendo-angular-l10n         : 17.0.1
@progress/kendo-angular-label        : 17.0.1
@progress/kendo-angular-layout       : 17.0.1
@progress/kendo-angular-menu         : 17.0.1
@progress/kendo-angular-navigation   : 17.0.1
@progress/kendo-angular-pdf-export   : 17.0.1
@progress/kendo-angular-popup        : 17.0.1
@progress/kendo-angular-progressbar  : 17.0.1
@progress/kendo-angular-tooltip      : 17.0.1
@progress/kendo-angular-treeview     : 17.0.1
@progress/kendo-angular-upload       : 17.0.1
@progress/kendo-angular-utils        : 17.0.1
ngx-toastr                           : 19.0.0

Failure Logs

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

@kbrilla
Copy link

kbrilla commented Dec 6, 2024

I can say we have the same error, tried using pnpm , npm and always get

Error: Command failed: /var/folders/gx/x91d543s40xcgtq5rndtfwzw0000gn/T/tmp-38218-Zx13A3gUkDMi/node_modules/.bin/nx _migrate --run-migration
    at genericNodeError (node:internal/errors:984:15)
    at wrappedFn (node:internal/errors:538:14)
    at checkExecSyncError (node:child_process:890:11)
    at execSync (node:child_process:962:15)
    at Object.runMigration (redacted/node_modules/nx/src/command-line/migrate/migrate.js:1073:42)
    at Object.handler (redacted/node_modules/nx/src/command-line/migrate/command-object.js:13:68) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 38300,
  stdout: null,
  stderr: null
}

@kbrilla
Copy link

kbrilla commented Dec 9, 2024

I was able to run migration but in very specific way on last friday so when version 20.2.0 was the latest one:

install nx globally version 20.2.0
npm i -g nx
and after than run it with ENV variable
NX_MIGRATE_USE_LOCAL=true nx migrate --run-migrations
but today when I tried to update to 20.2.1 it stopped working. What's more I cant find information about NX_MIGRATE_USE_LOCAL on NX website anymore
Before and today still it did not work when I run npx nx migrate --run-migrations or npm run nx migrate --run-migrations or NX_MIGRATE_USE_LOCAL=true npm run nx migrate --run-migrations so I don't understand what's going on anymore

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

No branches or pull requests

2 participants