You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
I'm having troubles executing a migration. I created a repository with a simple setup, therefore you can test it and get the errors I'm getting.
Here are the steps I did to get the error:
Created an nx workspace and generated mylibA.
I locally published v0.0.1 to verdaccio and install it in my nx workspace package.json as a dependency.
Then, I generated a migration for mylibA with version v0.0.2, built it and published to verdaccio once again.
I ran the command nx migrate @nx-migration/mylibA@0.0.2 and it was successful. It generated migrations.json and updated the package.json.
I ran npm install.
Finally, ran nx migrate --run-migrations and got the following errors:
a. "Failed to run update-0.0.2 from @nx-migration/mylibA. This workspace is NOT up to date!"
b. "The "path" argument must be of type string or an instance of Buffer or URL. Received null" or "Cannot find module 'C:\Test\nx-migration\node_modules@nx-migration\mylibA/./src/migrations/update-0.0.2/update-0.0.2'"
I'm having trouble in a different project where I publish my library to GitHub Packages and use it in other projects, however I created this setup so you could reproduce it more easily.
I have tried a lot of workarounds and nothing seems to work.
Best regards,
Diogo Pinto
Expected Behavior
The command nx migrate --run-migrations is executed successfully.
NX Failed to run update-0.0.3 from @nx-migration/mylibA. This workspace is NOT up to date!
NX The "path" argument must be of type string or an instance of Buffer or URL. Received null
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received null
at readFileSync (node:fs:439:14)
at readJsonFile (C:\Test\nx-migration\node_modules\nx\src\utils\fileutils.js:27:48)
at readMigrationCollection (C:\Test\nx-migration\node_modules\nx\src\command-line\migrate\migrate.js:1056:53)
at executeMigrations (C:\Test\nx-migration\node_modules\nx\src\command-line\migrate\migrate.js:919:52)
at runMigrations (C:\Test\nx-migration\node_modules\nx\src\command-line\migrate\migrate.js:1009:43)
at C:\Test\nx-migration\node_modules\nx\src\command-line\migrate\migrate.js:1050:19
at async handleErrors (C:\Test\nx-migration\node_modules\nx\src\utils\handle-errors.js:9:24)
Second Time:
nx migrate --run-migrations --verbose
NX Running migrations from 'migrations.json'
Running the following migrations:
@nx-migration/mylibA: update-0.0.3 (Migration for v0.0.3)
C:\Test\nx-migration\node_modules\nx\bin\nx.js
at Function._resolveFilename (node:internal/modules/cjs/loader:1249:15)
at Function.resolve (node:internal/modules/helpers:151:19)
at getImplementationPath (C:\Test\nx-migration\node_modules\nx\src\command-line\migrate\migrate.js:1078:28)
at runNxMigration (C:\Test\nx-migration\node_modules\nx\src\command-line\migrate\migrate.js:1033:42)
at executeMigrations (C:\Test\nx-migration\node_modules\nx\src\command-line\migrate\migrate.js:921:39)
at runMigrations (C:\Test\nx-migration\node_modules\nx\src\command-line\migrate\migrate.js:1009:43)
at C:\Test\nx-migration\node_modules\nx\src\command-line\migrate\migrate.js:1050:19
at async handleErrors (C:\Test\nx-migration\node_modules\nx\src\utils\handle-errors.js:9:24)
Package Manager Version
No response
Operating System
macOS
Linux
Windows
Other (Please specify)
Additional Information
No response
The text was updated successfully, but these errors were encountered:
Current Behavior
Hi!
I'm having troubles executing a migration. I created a repository with a simple setup, therefore you can test it and get the errors I'm getting.
Here are the steps I did to get the error:
a. "Failed to run update-0.0.2 from @nx-migration/mylibA. This workspace is NOT up to date!"
b. "The "path" argument must be of type string or an instance of Buffer or URL. Received null" or "Cannot find module 'C:\Test\nx-migration\node_modules@nx-migration\mylibA/./src/migrations/update-0.0.2/update-0.0.2'"
I'm having trouble in a different project where I publish my library to GitHub Packages and use it in other projects, however I created this setup so you could reproduce it more easily.
I have tried a lot of workarounds and nothing seems to work.
Best regards,
Diogo Pinto
Expected Behavior
The command nx migrate --run-migrations is executed successfully.
GitHub Repo
https://github.com/dfmpinto/nx-migration
Steps to Reproduce
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.0.6
nx : 20.0.6
@nx/js : 20.0.6
@nx/jest : 20.0.6
@nx/eslint : 20.0.6
@nx/workspace : 20.0.6
@nx/devkit : 20.0.6
@nx/esbuild : 20.0.6
@nx/eslint-plugin : 20.0.6
@nx/plugin : 20.0.6
typescript : 5.5.4
Registered Plugins:
@nx/eslint/plugin
@nx/jest/plugin
Failure Logs
First time:
NX Running migrations from 'migrations.json'
Running the following migrations:
Running migration @nx-migration/mylibA: update-0.0.3
NX Failed to run update-0.0.3 from @nx-migration/mylibA. This workspace is NOT up to date!
NX The "path" argument must be of type string or an instance of Buffer or URL. Received null
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received null
at readFileSync (node:fs:439:14)
at readJsonFile (C:\Test\nx-migration\node_modules\nx\src\utils\fileutils.js:27:48)
at readMigrationCollection (C:\Test\nx-migration\node_modules\nx\src\command-line\migrate\migrate.js:1056:53)
at executeMigrations (C:\Test\nx-migration\node_modules\nx\src\command-line\migrate\migrate.js:919:52)
at runMigrations (C:\Test\nx-migration\node_modules\nx\src\command-line\migrate\migrate.js:1009:43)
at C:\Test\nx-migration\node_modules\nx\src\command-line\migrate\migrate.js:1050:19
at async handleErrors (C:\Test\nx-migration\node_modules\nx\src\utils\handle-errors.js:9:24)
Second Time:
NX Running migrations from 'migrations.json'
Running the following migrations:
Running migration @nx-migration/mylibA: update-0.0.3
NX Failed to run update-0.0.3 from @nx-migration/mylibA. This workspace is NOT up to date!
NX Cannot find module 'C:\Test\nx-migration\node_modules@nx-migration\mylibA/./src/migrations/update-0.0.3/update-0.0.3'
Require stack:
Error: Cannot find module 'C:\Test\nx-migration\node_modules@nx-migration\mylibA/./src/migrations/update-0.0.3/update-0.0.3'
Require stack:
at Function._resolveFilename (node:internal/modules/cjs/loader:1249:15)
at Function.resolve (node:internal/modules/helpers:151:19)
at getImplementationPath (C:\Test\nx-migration\node_modules\nx\src\command-line\migrate\migrate.js:1078:28)
at runNxMigration (C:\Test\nx-migration\node_modules\nx\src\command-line\migrate\migrate.js:1033:42)
at executeMigrations (C:\Test\nx-migration\node_modules\nx\src\command-line\migrate\migrate.js:921:39)
at runMigrations (C:\Test\nx-migration\node_modules\nx\src\command-line\migrate\migrate.js:1009:43)
at C:\Test\nx-migration\node_modules\nx\src\command-line\migrate\migrate.js:1050:19
at async handleErrors (C:\Test\nx-migration\node_modules\nx\src\utils\handle-errors.js:9:24)
Package Manager Version
No response
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: