Skip to content

Using yarn 2 pnp with package.json scripts cause ENOTDIR #184

Description

@Gisleburt

I've added migrate to my package json so that it always passes in the correct store, complier and template options¹

If I try to use it directly, eg:

{
  "scripts": {
    "migrate-create": "migrate create --template-file=\"./migrations-meta/template.ts\" --compiler=\"ts:./migrations-meta/compiler.js\"",
  }
}

When I run it with yarn 2 I get the following error

$ yarn run migrate-create test
internal/child_process.js:407
    throw errnoException(err, 'spawn');
    ^

Error: spawn ENOTDIR
    at ChildProcess.spawn (internal/child_process.js:407:11)
    at spawn (child_process.js:548:9)
    at Command.executeSubCommand (./.yarn/cache/commander-npm-2.20.3-d8dcbaa39b-b73428e97d.zip/node_modules/commander/index.js:562:14)
    at Command.parse (./.yarn/cache/commander-npm-2.20.3-d8dcbaa39b-b73428e97d.zip/node_modules/commander/index.js:488:17)
    at Object.<anonymous> (./.yarn/cache/migrate-npm-1.7.0-d0c8b01ed6-666dcd3e4d.zip/node_modules/migrate/bin/migrate:15:4)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.external_module_.Module._load (./.pnp.js:20698:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) {
  errno: 'ENOTDIR',
  code: 'ENOTDIR',
  syscall: 'spawn'
}

I have a work around by prefixing migrate with npx which then installs and runs a global version of migrate.

We're using yarn 2 with pnp, however other binaries run ok. Did I miss something?

¹ Is there a runtime configuration (rc) file that I missed or isn't not documented so that I don't have to do this?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions