0

安装 express-gateway 后,当我使用以下命令创建 API 网关时,

eg gateway create

我收到以下错误。


[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)

我尝试删除 node_modules 文件夹并重新安装它,但问题仍然存在。

4

1 回答 1

0

当脚手架/创建部分出现问题时,通常会发生这种情况。我还可以看到您正在从 Windows 运行命令。

我们有不同的用户抱怨我现在没有积极支持的操作系统的一些奇怪的 CLI 问题。

从存储库中复制该文件并将其放置在正确的目录中应该不会太难。我知道这是一种解决方法,但它应该可以解决问题。

于 2019-05-04T19:15:37.863 回答