Skip to content

npm install --save-dev failed at postinstall stage #2798

@xmliszt

Description

@xmliszt

Bug report

  • I confirm this is a bug with Supabase, not with my own application.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord. (Found similar issues, but none of them addressed my problem)

Describe the bug

When running npm install supabase --save-dev, the process hangs and then failed. The log shows that it fails at the postinstall stage with supabase@1.207.9 postinstall { code: 13, signal: null }.

I tried a lot of methods from online, all didn't actually work for me unfortunately. Things I have tried:

  • different node version (tried v16, v18, v20)
  • force clean npm cache
  • delete package-lock.json and retry installing
  • delete node_modules and retry installing
  • completely uninstall node and npm and then re-install them
  • manual overwrite npm registry
  • restarted my MacBook
  • factory reset my MacBook
  • reset user permission for /usr directory
  • check that no proxy has been configured for npm
  • check that .npmrc file has no outdated access token or wrong registry (in fact currently I don't even have .npmrc in the $HOME so it should be running default settings!)

Here are some additional information that might help:

  • My MacBook is M1 Pro MacBook Pro (Running on Sequoia 15.1)
  • node version currently use via NVM : v20.10.0
  • npm version: 10.2.3
  • supabase cli version: @latest

Some observations:

  1. running sudo npm install supabase --save-dev works for me. Therefore, I suspect does supabase cli postinstall script tries to access some files that require higher privileges?
  2. running npm install supabase@1.89.1 --save-dev works for me too. Therefore, suspect there is some update to the postinstall.js script between the latest version and the v1.1 version such that this bug is introduced?
  3. managed to find out that v1.89.1 works for me and then v1.90.0 failed. So there is some changes introduced in v1.90.0 that causes this to happen? -- I drilled down and found that this particular commit 571f336 causes subsequent version installation to fail.
    CleanShot 2024-10-24 at 23 50 52@2x

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Run npm install supabase@latest --save-dev
  2. The npm process will hang when it reaches run supabase@1.207.9 postinstall step
  3. And then it will fail after hanging for some time T_T

(However, this might not be reproducible for you because I have used some other laptops to try, and they all can install successfully 😭 I really don't know what happened to my device)

Expected behavior

Running npm install supabase@latest --save-dev should succeed.

Screenshots

Here is the error log for my last npm run npm install supabase --save-dev (I removed some lines that are not related to this package)

npm WARN deprecated @humanwhocodes/config-array@0.11.14: Use @eslint/config-array instead
npm WARN deprecated abab@2.0.6: Use your platform's native atob() and btoa() methods instead
npm WARN deprecated fsevents@2.1.3: "Please update to latest v2.3 or v2.2"
npm WARN deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
npm WARN deprecated domexception@4.0.0: Use your platform's native DOMException instead
npm http fetch GET 200 https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz 2924ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz 2929ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz 2928ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz 2935ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz 2932ms (cache miss)
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm http fetch GET 200 https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz 2940ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz 2976ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/static-eval/-/static-eval-2.0.2.tgz 2998ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz 3010ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz 3028ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz 3065ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/node-fetch 785ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/jsonpath-plus 786ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz 3570ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/ts-deepcopy/-/ts-deepcopy-0.1.4.tgz 3652ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/@vercel%2ffun 489ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/type-fest/-/type-fest-4.8.3.tgz 4273ms (cache miss)
npm http fetch GET 200 https://registry.npmjs.org/@tensorflow%2ftfjs-core 479ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@mapbox%2fnode-pre-gyp 139ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@vercel%2fnode 345ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@vercel%2frouting-utils 1579ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/path-match 65ms (cache revalidated)
npm http fetch GET 200 https://registry.npmjs.org/@supabase%2fssr 442ms (cache revalidated)
npm info run bufferutil@4.0.8 install node_modules/bufferutil node-gyp-build
npm info run utf-8-validate@5.0.10 install node_modules/utf-8-validate node-gyp-build
npm http fetch GET 200 https://registry.npmjs.org/@ironclad%2frivet-core 1506ms (cache revalidated)
npm info run utf-8-validate@5.0.10 install { code: 0, signal: null }
npm http fetch GET 200 https://registry.npmjs.org/vercel 57ms (cache revalidated)
...
npm info run supabase@1.207.9 postinstall node_modules/supabase node scripts/postinstall.js
...
npm info run supabase@1.207.9 postinstall { code: 13, signal: null }
npm verb stack Error: command failed
npm verb stack     at ChildProcess.<anonymous> (/Users/yx/.nvm/versions/node/v20.10.0/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:53:27)
npm verb stack     at ChildProcess.emit (node:events:514:28)
npm verb stack     at maybeClose (node:internal/child_process:1105:16)
npm verb stack     at ChildProcess._handle.onexit (node:internal/child_process:305:5)
npm verb pkgid supabase@1.207.9
npm verb Darwin 24.1.0
npm verb node v20.10.0
npm verb npm  v10.2.3
npm ERR! code 13
npm ERR! command failed
npm ERR! command sh -c node scripts/postinstall.js
npm ERR! Downloading https://github.com/supabase/cli/releases/download/v1.207.9/supabase_darwin_arm64.tar.gz
npm ERR! Downloading https://github.com/supabase/cli/releases/download/v1.207.9/supabase_1.207.9_checksums.txt
npm verb exit 13
npm verb unfinished npm timer reify 1729781821448
npm verb unfinished npm timer reify:build 1729781829533
npm verb unfinished npm timer build 1729781829534
npm verb unfinished npm timer build:deps 1729781829534
npm verb unfinished npm timer build:run:postinstall 1729781830308
npm verb unfinished npm timer build:run:postinstall:node_modules/supabase 1729781830313
npm verb code 13

System information

  • OS: macOS
  • Version of supabase: 1.207.9
  • Version of Node.js: v20.10.0
  • Version of npm: 10.2.3
  • M1 Pro MacBook Pro (Running on Sequoia 15.1)

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