0

After installing express-gateway, when I create API gateway using following command,

eg gateway create

I am getting following error.


[EG:config] error: Cannot find module 'C:\My Content\Microservice Projects\FIFA Team Selection\config\models\users.json'
C:\My Content\Microservice Projects\FIFA Team Selection\node_modules\express-gateway\lib\config\index.js:15
  throw err;
  ^

Error: Cannot find module 'C:\My Content\Microservice Projects\FIFA Team Selection\config\models\users.json'
    at Function.Module._resolveFilename (module.js:538:15)
    at Function.Module._load (module.js:468:25)
    at Module.require (module.js:587:17)
    at require (internal/module.js:11:18)
    at forEach.model (C:\My Content\Microservice Projects\FIFA Team Selection\node_modules\express-gateway\lib\config\config.js:68:27)
    at Array.forEach (<anonymous>)
    at Config.loadModels (C:\My Content\Microservice Projects\FIFA Team Selection\node_modules\express-gateway\lib\config\config.js:65:61)
    at Object.<anonymous> (C:\My Content\Microservice Projects\FIFA Team Selection\node_modules\express-gateway\lib\config\index.js:11:10)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
child_process.js:624
    throw err;
    ^

Error: Command failed: C:\My Content\Microservice Projects\FIFA Team Selection\node_modules\.bin\eg.cmd gateway create
    at checkExecSyncError (child_process.js:601:13)
    at execFileSync (child_process.js:621:13)
    at exports.executeInScope.env (C:\Users\bmaheshwari\AppData\Roaming\npm\node_modules\express-gateway\bin\execution-scope.js:37:5)
    at Object.exports.bootstrap (C:\Users\bmaheshwari\AppData\Roaming\npm\node_modules\express-gateway\bin\environment.js:11:7)
    at Object.<anonymous> (C:\Users\bmaheshwari\AppData\Roaming\npm\node_modules\express-gateway\bin\index.js:9:46)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)

I tried removing node_modules folder and re-installing it again, but issue persists.

1 Answers1

0

This can usually happen when something is wrong during the scaffolding/creation section. I can also see you're running the command from Windows.

We had different users complaining about some weird CLI problems with that operating system which I'm not actively supporting right now.

It shouldn't be too hard to copy that file from the repository and place it in the right directory. I know it's a workaround, but it should do the trick.

Vincenzo
  • 1,549
  • 1
  • 9
  • 17