node-migrate: Can't migrate on Windows

I have set of migrations which works perfectly on linux systems, but when I try to run migrations on Windows machine I get the following:

{ProjectPath}>yarn run migrate
yarn run v1.2.1
$ node -r dotenv/config node_modules/.bin/migrate --state-file runtime/.migrate
{ProjectPath}\node_modules\.bin\migrate:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
          ^^^^^^^

SyntaxError: missing ) after argument list
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:588:28)
    at Object.Module._extensions..js (module.js:635:10)
    at Module.load (module.js:545:32)
    at tryModuleLoad (module.js:508:12)
    at Function.Module._load (module.js:500:3)
    at Function.Module.runMain (module.js:665:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

This is migrate script command:

"migrate": "node -r dotenv/config node_modules/.bin/migrate --state-file runtime/.migrate",

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 16

Most upvoted comments

Awesome, this I can go on. I just read through that module module’s readme and it looks solid. I will work on support for this. Thanks for following up with me!

Not really a solution, but db-migrate loads .env automatically (using dotenv) and I would personally like it if this module did the same. It’s quite convenient, for exactly the use case you are using it for, and I believe it to be somewhat of a standard to have .env files…