adrien2p / medusa-extender

:syringe: Medusa on steroid, take your medusa project to the next level with some badass features :rocket:
https://adrien2p.github.io/medusa-extender/
MIT License
320 stars 40 forks source link

[BUG] Medusa Server not starting after adding medusa-extender to existing project #179

Closed AlexTechNoir closed 1 year ago

AlexTechNoir commented 1 year ago

Describe the bug

I was following this medusa-extender docs: run npm install medusa-extender and ./node_modules/.bin/medex init. Then, I launched npm run start, but the terminal showed an error:

$ npm run start

> medusa-starter-default@0.0.1 start
> npm run build && NODE_ENV=development node ./dist/main.js

> medusa-starter-default@0.0.1 build
> rm -rf dist && ./node_modules/.bin/tsc -p tsconfig.json

'.' is not recognized as an internal or external command,
operable program or batch file.

This is happening even after uninstalling medusa-exntender

To Reproduce

Steps to reproduce the behavior:

  1. Setup Medusa Server (with Postgres)
  2. Add medusa-extender to an existing Medusa project by running npm install medusa-extender and ./node_modules/.bin/medex init
  3. Run npm run start
  4. See error in the terminal

Expected behavior

Medusa Server should run as extender docs said

Package version:

    "dependencies": {
        "@medusajs/medusa": "^1.6.0",
        "@medusajs/medusa-cli": "^1.3.3",
        "medusa-extender": "^1.8.8",
        "medusa-file-cloudinary": "^1.0.1",
        "medusa-fulfillment-manual": "^1.1.31",
        "medusa-interfaces": "^1.3.3",
        "medusa-payment-manual": "^1.0.16",
        "medusa-payment-stripe": "^1.1.45",
        "typeorm": "^0.2.36"
    },
AlexTechNoir commented 1 year ago

Upd: I managed to run the script by appending "node" into "build" script, like "build": "rm -rf dist && node ./node_modules/.bin/tsc -p tsconfig.json", but now terminal says:

$ npm run start

> medusa-starter-default@0.0.1 start
> npm run build && NODE_ENV=development node ./dist/main.js

> medusa-starter-default@0.0.1 build
> rm -rf dist && node ./node_modules/.bin/tsc -p tsconfig.json

C:\Users\Alex\Desktop\medusa\backend\node_modules\.bin\tsc:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
          ^^^^^^^

SyntaxError: missing ) after argument list
    at Object.compileFunction (node:vm:352:18)
    at wrapSafe (node:internal/modules/cjs/loader:1031:15)
    at Module._compile (node:internal/modules/cjs/loader:1065:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47
adrien2p commented 1 year ago

Tsc should not be run using node in front of it. Are you on windows?

adrien2p commented 1 year ago

If you are on windows, relative paths works differently so you should look for that

AlexTechNoir commented 1 year ago

Yes, I'm on Windows. Thanks for the tip!