search
LoginSignup
0
Help us understand the problem. What are the problem?

More than 1 year has passed since last update.

posted at

Swagger(node.js)でCannot find Module swagger_routerが出たときの対処

エラー(全文)

Error: Cannot find module 'C:\path\api\fittings\swagger_router'
Require stack:
- C:\path\node_modules\bagpipes\lib\fittingTypes\user.js     
- C:\path\node_modules\bagpipes\lib\bagpipes.js
- C:\path\node_modules\bagpipes\lib\index.js
- C:\path\node_modules\swagger-node-runner\index.js
- C:\path\node_modules\swagger-express-mw\lib\index.js       
- C:\path\app.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at createFitting (C:\path\node_modules\bagpipes\lib\fittingTypes\user.js:18:20)
    at Bagpipes.newFitting (C:\path\node_modules\bagpipes\lib\bagpipes.js:158:17)
    at Bagpipes.createFitting (C:\path\node_modules\bagpipes\lib\bagpipes.js:147:22)
    at Bagpipes.createPipe (C:\path\node_modules\bagpipes\lib\bagpipes.js:111:19)
    at Bagpipes.getPipe (C:\path\node_modules\bagpipes\lib\bagpipes.js:50:38)
    at C:\path\node_modules\bagpipes\lib\bagpipes.js:34:10   

解決策

node_modules/bagpipes/libfittingTypes/user.js24 列目、

var split = err.message.split(path.sep);

var split = err.message.split('\n')[0].split(path.sep);

に変更する

参考

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up
0
Help us understand the problem. What are the problem?