nx migrate - Skip npm install when running nx migrate --run-migration

Solution 1:

If your migration file is already generated you could use NX_MIGRATE_SKIP_INSTALL=true nx migrate --run-migrations=migrations.json to run your migration and skip the npm install phase.

To create a migrations.json you can use this example:

{
  "migrations": [
    {
      "version": "1.33",
      "description": "update-1.33",
      "cli": "nx",
      "implementation": "./src/migrations/update-1.33/update-1.33",
      "package": "./dist/libs/your-path",
      "name": "update-1.33"
    }
  ]
}