medusajs / medusa

The world's most flexible commerce platform.
https://medusajs.com
MIT License
26.26k stars 2.67k forks source link

[Bug]: medusa-payment-stripe ^6.0.11 does not work with @medusajs/medusa ^2.0.4 #10115

Closed mrfzd closed 2 weeks ago

mrfzd commented 2 weeks ago

Package.json file

{
  "name": "medusa-starter-default",
  "version": "0.0.1",
  "description": "A starter for Medusa projects.",
  "author": "Medusa (https://medusajs.com)",
  "license": "MIT",
  "keywords": [
    "sqlite",
    "postgres",
    "typescript",
    "ecommerce",
    "headless",
    "medusa"
  ],
  "scripts": {
    "build": "medusa build",
    "seed": "medusa exec ./src/scripts/seed.ts",
    "start": "medusa start",
    "dev": "medusa develop",
    "test:integration:http": "TEST_TYPE=integration:http NODE_OPTIONS=--experimental-vm-modules jest --silent=false --runInBand --forceExit",
    "test:integration:modules": "TEST_TYPE=integration:modules NODE_OPTIONS=--experimental-vm-modules jest --silent --runInBand --forceExit",
    "test:unit": "TEST_TYPE=unit NODE_OPTIONS=--experimental-vm-modules jest --silent --runInBand --forceExit"
  },
  "dependencies": {
    "@medusajs/admin-sdk": "^2.0.4",
    "@medusajs/cli": "^2.0.4",
    "@medusajs/framework": "^2.0.4",
    "@medusajs/medusa": "^2.0.4",
    "@mikro-orm/core": "5.9.7",
    "@mikro-orm/knex": "5.9.7",
    "@mikro-orm/migrations": "5.9.7",
    "@mikro-orm/postgresql": "5.9.7",
    "awilix": "^8.0.1",
    "pg": "^8.13.0"
  },
  "devDependencies": {
    "@medusajs/test-utils": "^2.0.4",
    "@mikro-orm/cli": "5.9.7",
    "@swc/core": "1.5.7",
    "@swc/jest": "^0.2.36",
    "@types/jest": "^29.5.13",
    "@types/node": "^20.0.0",
    "@types/react": "^18.3.2",
    "@types/react-dom": "^18.2.25",
    "jest": "^29.7.0",
    "prop-types": "^15.8.1",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "ts-node": "^10.9.2",
    "typescript": "^5.6.2",
    "vite": "^5.2.11"
  },
  "engines": {
    "node": ">=20"
  }
}

Node.js version

v20.10.0

Database and its version

PostgreSQL 16.0

Operating system name and version

Ubuntu 24.04

Browser name

Chrome

What happended?

Trying install "medusa-payment-stripe": "^6.0.11" with "@medusajs/medusa": "^2.0.4" but getting the following error!

npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: medusa-starter-default@0.0.1
npm error Found: @medusajs/medusa@2.0.4
npm error node_modules/@medusajs/medusa
npm error   @medusajs/medusa@"^2.0.4" from the root project
npm error
npm error Could not resolve dependency:
npm error peer @medusajs/medusa@"^1.12.0" from medusa-payment-stripe@6.0.11
npm error node_modules/medusa-payment-stripe
npm error   medusa-payment-stripe@"^6.0.11" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error C:\Users\User\AppData\Local\npm-cache\_logs\2024-11-15T09_52_34_037Z-eresolve-report.txt
npm error A complete log of this run can be found in: C:\Users\User\AppData\Local\npm-cache\_logs\2024-11-15T09_52_34_037Z-debug-0.log

I also tried adding the following peer dependency and then installing stripe but this didn't work either!

  "peerDependencies": {
    "@medusajs/medusa": "^1.12.0"
  },

Expected behavior

To work with the latest Medusa

Actual behavior

Does not work with the latest Medusa ^2.0.4

Link to reproduction repo

This could be replicated using Medusa starter kit too

trinhcongduc commented 2 weeks ago

Medusa v2 seems not work with Plugins right now, so we need to wait they update.

christiananese commented 2 weeks ago

Hey @mrfzd , thanks for reporting. medusa-payment-stripe won't work with Medusa 2.0 We have a nice guide in our docs on how to set up Stripe with v2.

Feel free to open a new issue if it doesn't solve your problem.