skip to Main Content

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:UserssaadbAppDataRoamingnpmnode_modulesmigrate-mongosamplesundefinedmigration.js' Error: ENOENT: no such file or directory, lstat 'C:UserssaadbAppDataRoamingnpmnode_modulesmigrate-mongosamplesundefinedmigration.js'

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

3

Answers


  1. Running the following code solved the problem:

    npx migrate-mongo create blacklist_the_beatles
    
    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
  3. Just add moduleSystem property in your migrate-mongo-config.js

    It can be esm or commonjs, depends on which one you using. More details here – https://github.com/seppevs/migrate-mongo/blob/49e6de971bc9581ce3a2321da2180a7877aff3a6/samples/esm/migrate-mongo-config.js

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search