Skip to content

yarn: postinstall script must be run manually #4047

@alxndrsn

Description

@alxndrsn

Describe the bug

Using yarn, with supabase added in package.json's devDependencies, npx supabase fails in a couple of ways:

When run from an npm script:

node:internal/modules/cjs/loader:1372
  throw err;
  ^

Error: Cannot find module './node_modules/supabase/bin/supabase'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1369:15)
    at defaultResolveImpl (node:internal/modules/cjs/loader:1025:19)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1030:22)
    at Module._load (node:internal/modules/cjs/loader:1179:37)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
    at Module.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:152:5)
    at node:internal/main/run_main_module:33:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

When run using npx:

$ npx supabase
sh: 1: supabase: not found

To Reproduce

TODO

To Recover

cd node_modules/supabase && node ./scripts/postinstall.js

Expected behavior

postinstall script should have run automatically; if it did not, then some helpful error should be shown

Screenshots

N/A

System information
Rerun the failing command with --create-ticket flag.

  • Ticket ID: [e.g. ab1ac733e31e4f928a4d7c8402543712]
  • Version of OS: [e.g. Ubuntu 22.04]
  • Version of CLI: [e.g. v1.60.0]
  • Version of Docker: [e.g. v25.0.3]
  • Versions of services: [output from supabase services command]

Additional context
If applicable, add any other context about the problem here.

  • Browser [e.g. chrome, safari]
  • Version of supabase-js [e.g. v2.22.0]
  • Version of Node.js [e.g. v16.20.0]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions