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

ERR_INVALID_FILE_URL_PATH on migration:undo #756

Open
BrenoMNAsc opened this issue May 31, 2024 · 0 comments
Open

ERR_INVALID_FILE_URL_PATH on migration:undo #756

BrenoMNAsc opened this issue May 31, 2024 · 0 comments

Comments

@BrenoMNAsc
Copy link

This error always happened, when I went to see why it was happening, it was taking the curMigName as the _current_bak.json, I just did a for there to get the right file, I didn't understand why this happened only cmg and n see no one talking about it

Current state file: _current.json, Revision: 3
sequelize-mig migration:undo

Undo the last migration:make (it will only delete migration file and revert stat
e updates

Positionals:
force, f force undo even if revisions not equal
[boolean]
delete-current-state, del-cur-stt delete current state (default: true)
[boolean] [default: true]
delete-current-migration, del-cur-mig delete current migration (default: true
) [boolean] [default: true]
rename-backup-state, ren-bak-stt rename backup state (default: true)
[boolean] [default: true]

Options:
-h, --help Show help [boolean]
-v, --version Show version number [boolean]
--pwd-path, --pwdp Override PWD (or just navigate to specified
folder in it) (default to ./) [string]
--ignore-sequelizerc, --ignrc force pwd even on sequelizerc (default to f
alse) [boolean]
--sequelizerc-path, --seqrcp The path to the .sequelizerc file (default
to ./.sequelizerc) [string]
--migrations-path, --migp The path to the migrations folder (default
to ./migrations) [string]
--models-path, --modp The path to the models folder (default to .
/models) [string]
--state-path, --statp The path to the state folder where schema i
s saved (default to migrations-path)
[string]
--index-file-path, --indxp The path to the index file (default to mode
ls-path/index.js) [string]
--log-level, --ll The less, The more you see, default: 3...
[number] [default: 3]

Examples:
sequelize-mig migration:undo

TypeError [ERR_INVALID_FILE_URL_PATH]: File URL path must be absolute
at getPathFromURLWin32 (node:internal/url:1433:11)
at fileURLToPath (node:internal/url:1464:35)
at finalizeResolution (node:internal/modules/esm/resolve:246:12)
at moduleResolve (node:internal/modules/esm/resolve:933:10)
at defaultResolve (node:internal/modules/esm/resolve:1157:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:383:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:352:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:227:38)
at ModuleLoader.import (node:internal/modules/esm/loader:315:34)
at importModuleDynamically (node:internal/modules/esm/translators:161:31) {
code: 'ERR_INVALID_FILE_URL_PATH',
input: 'file:////C:/Users/user/WebstormProjects/projetctTeste/migrations/_current_bak.json',
module: 'file:///C:/Users/user/WebstormProjects/projectTeste/node_modules/sequelize-mig/bin/migration/undo.js'
}
How I Solved It:

image

I removed a slash from line 56 and did the for to get the last file with extension .js, I still don't understand how such a silly error happened, I don't think it was a @MRVMV error, maybe I installed it wrong or I don't know

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

1 participant