vercel / nextjs-subscription-payments

Clone, deploy, and fully customize a SaaS subscription application with Next.js.
https://subscription-payments.vercel.app/
MIT License
6.23k stars 1.27k forks source link

Can't install Supabase CLI following the instructions #144

Closed JPVRS closed 1 year ago

JPVRS commented 1 year ago

I'm following along with the instructions in the Readme, and the Supabase CLI installation isn't working. This is the output I'm getting:

$ npm install supabase --save-dev

> supabase@1.15.1 preinstall /workspaces/nextjs-stripe-supabase/node_modules/supabase
> node scripts/preinstall.js

internal/process/esm_loader.js:74
    internalBinding('errors').triggerUncaughtException(
                              ^

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received an instance of Object
    at new NodeError (internal/errors.js:322:7)
    at validateString (internal/validators.js:124:11)
    at Object.basename (path.js:1281:5)
    at parsePackageJson (file:///workspaces/nextjs-stripe-supabase/node_modules/supabase/scripts/preinstall.js:62:22)
    at async main (file:///workspaces/nextjs-stripe-supabase/node_modules/supabase/scripts/preinstall.js:88:16)
    at async file:///workspaces/nextjs-stripe-supabase/node_modules/supabase/scripts/preinstall.js:115:1 {
  code: 'ERR_INVALID_ARG_TYPE'
}
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-linux-arm-gnueabihf@12.3.0 (node_modules/next/node_modules/@next/swc-linux-arm-gnueabihf):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-linux-arm-gnueabihf@12.3.0: wanted {"os":"linux","arch":"arm"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-darwin-arm64@12.3.0 (node_modules/next/node_modules/@next/swc-darwin-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-darwin-arm64@12.3.0: wanted {"os":"darwin","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-android-arm-eabi@12.3.0 (node_modules/next/node_modules/@next/swc-android-arm-eabi):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-android-arm-eabi@12.3.0: wanted {"os":"android","arch":"arm"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-linux-arm64-musl@12.3.0 (node_modules/next/node_modules/@next/swc-linux-arm64-musl):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-linux-arm64-musl@12.3.0: wanted {"os":"linux","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-freebsd-x64@12.3.0 (node_modules/next/node_modules/@next/swc-freebsd-x64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-freebsd-x64@12.3.0: wanted {"os":"freebsd","arch":"x64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-darwin-x64@12.3.0 (node_modules/next/node_modules/@next/swc-darwin-x64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-darwin-x64@12.3.0: wanted {"os":"darwin","arch":"x64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-android-arm64@12.3.0 (node_modules/next/node_modules/@next/swc-android-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-android-arm64@12.3.0: wanted {"os":"android","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-linux-arm64-gnu@12.3.0 (node_modules/next/node_modules/@next/swc-linux-arm64-gnu):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-linux-arm64-gnu@12.3.0: wanted {"os":"linux","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-win32-ia32-msvc@12.3.0 (node_modules/next/node_modules/@next/swc-win32-ia32-msvc):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-win32-ia32-msvc@12.3.0: wanted {"os":"win32","arch":"ia32"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-win32-arm64-msvc@12.3.0 (node_modules/next/node_modules/@next/swc-win32-arm64-msvc):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-win32-arm64-msvc@12.3.0: wanted {"os":"win32","arch":"arm64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @next/swc-win32-x64-msvc@12.3.0 (node_modules/next/node_modules/@next/swc-win32-x64-msvc):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @next/swc-win32-x64-msvc@12.3.0: wanted {"os":"win32","arch":"x64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN nextjs-subscription-payments@0.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! supabase@1.15.1 preinstall: `node scripts/preinstall.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the supabase@1.15.1 preinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/codespace/.npm/_logs/2022-11-26T17_46_46_573Z-debug.log
thorwebdev commented 1 year ago

Can you try running npx supabase --version and see if your machine prompts to install that way?

sweatybridge commented 1 year ago

Also, could you share with us the contents of package.json that you have initialised?

JPVRS commented 1 year ago

Can you try running npx supabase --version and see if your machine prompts to install that way?

No luck, unfortunately.

$ npx supabase --version
internal/process/esm_loader.js:74
    internalBinding('errors').triggerUncaughtException(
                              ^

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received an instance of Object
    at new NodeError (internal/errors.js:322:7)
    at validateString (internal/validators.js:124:11)
    at Object.basename (path.js:1281:5)
    at parsePackageJson (file:///home/codespace/.npm/_npx/9064/lib/node_modules/supabase/scripts/preinstall.js:62:22)
    at async main (file:///home/codespace/.npm/_npx/9064/lib/node_modules/supabase/scripts/preinstall.js:88:16)
    at async file:///home/codespace/.npm/_npx/9064/lib/node_modules/supabase/scripts/preinstall.js:115:1 {
  code: 'ERR_INVALID_ARG_TYPE'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! supabase@1.17.0 preinstall: `node scripts/preinstall.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the supabase@1.17.0 preinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/codespace/.npm/_logs/2022-11-30T23_24_35_276Z-debug.log
Install for [ 'supabase@latest' ] failed with code 1
JPVRS commented 1 year ago

Also, could you share with us the contents of package.json that you have initialised?

Attached package.json.txt package-lock.json.txt yarn.lock.txt

sweatybridge commented 1 year ago

@JPVRS you might have a corrupted supabase module in your local npm. Could you check the contents of the following files:

cat /workspaces/nextjs-stripe-supabase/node_modules/supabase/package.json
cat /home/codespace/.npm/_npx/9064/lib/node_modules/supabase/package.json

Both of them should contain the line "bin": "bin/supabase",

Last resort is to delete your node_modules directory and try npm i supabase --save-dev again.

Let me know if it works.

JPVRS commented 1 year ago

I "resolved" this by setting up the environment on my local machine instead of using Github Codespaces (which is unfortunate because other than this issue, Codespaces was working great for me).