Hello @Christy_07873 -
Was hitting same issue.
Finally realized - with this migration script we’re simply running
node directly on this single script - no prior setup, no “index.js” to attend to things like environment configuration and so forth, the way we have it when we use
npm start to kick off the whole running of the app + api.
So, I finally brought one line from the top-most
/mflix-js/index.js into the simple
movie-last-updated-migration.js script, namely:
and that got it to work.
Without that, “process.env” I think fails to do anything, find anything.
I think you were on the right track, to try to keep your database password out of any source code! (even if it was a simple data processing script, sort of on the side, outside scope of the rest of the running app + api). Still, not something you’d want to get into a Git repository…