MongoDb can't create migration scripts

Viewed 499

I am trying to create a migration script on an existing project with already initialized migrate-mongo. I'm using windows btw.

Here is my problem. When I try to create a script using this command migrate-mongo create blacklist_the_beatles I get this error.

ERROR: ENOENT: no such file or directory, lstat 'C:\Users\saadb\AppData\Roaming\npm\node_modules\migrate-mongo\samples\undefined\migration.js' Error: ENOENT: no such file or directory, lstat 'C:\Users\saadb\AppData\Roaming\npm\node_modules\migrate-mongo\samples\undefined\migration.js'

I am running the command from VS code terminal. Is this right or should I run it from somewhere else

3 Answers

Running the following code solved the problem:

npx migrate-mongo create blacklist_the_beatles

Seems very weird, buy I was able to solve the issue by manually creating "undefined" folder in the prompted path, and I also put there all files from commonjs folder.

Related