siemens / codeface

Codeface is a framework for analysing technical and social aspects of software development
siemens.github.io/codeface
GNU General Public License v2.0
67 stars 38 forks source link

Error in id_service.js during ID server startup #13

Closed matthias-ge closed 9 years ago

matthias-ge commented 9 years ago

I have tried to install codeface by following the installation steps. As I am on Debian GNU/Linux 7, I adjusted some steps of the installation.

Finally starting the ID server fails with the following output:

~/codeface/id_service$ nodejs id_service.js ../codeface.conf Starting REST Service with logging level "info" info: Connecting to MySQL at codeface@localhost database codeface

/home/matthias/codeface/id_service/id_service.js:66 app.configure(function() { ^ TypeError: Object function (req, res, next) { app.handle(req, res, next); } has no method 'configure' at Object. (/home/matthias/codeface/id_service/id_service.js:66:5) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:906:3

The version of nodejs is 10.29, the version of npm 2.2.0.

Codeface on the other side seems to be installed correct. Launching "codeface test" only produces the error, that the ID service/server can not be reached.

mitchell-joblin commented 9 years ago

Hi Matthias,

Thanks for posting your issue to the mailing list.

On Fri, Jan 23, 2015 at 9:42 AM, matthias-ge notifications@github.com wrote:

I have tried to install codeface by following the installation steps. As I am on Debian GNU/Linux 7, I adjusted some steps of the installation.

Finally starting the ID server fails with the following output:

~/codeface/id_service$ nodejs id_service.js ../codeface.conf Starting REST Service with logging level "info" info: Connecting to MySQL at codeface@localhost database codeface

/home/matthias/codeface/id_service/id_service.js:66 app.configure(function() { ^ TypeError: Object function (req, res, next) { app.handle(req, res, next); } has no method 'configure' at Object. (/home/matthias/codeface/id_service/id_service.js:66:5) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:906:3

The version of nodejs is 10.29, the version of npm 2.2.0.

I have not personally experienced this issue before but I am quite certain that it has to do with the version of the nodejs express module. It seems that the "app.configure" was removed sometime in April last year (ref: https://github.com/strongloop/express/blob/master/History.md). I recommend that you try the moving the code out of the app.configure block in id_service.js (ref: http://stackoverflow.com/questions/18637148/using-app-configure-in-express).

If you have any more trouble let me know and please submit a patch if this fixes the problem.

Kind regards,

Mitchell

Codeface on the other side seems to be installed correct. Launching "codeface test" only produces the error, that the ID service/server can not be reached.

— Reply to this email directly or view it on GitHub.

matthias-ge commented 9 years ago

You are right, Mitchell - the issue depends on the changes in the versions of nodejs. To solve the problems completely first the middleware bodyParser has to be installed separately. Therefore 'npm install body-parser' has to be executed in the directory id_service. Following id_service.js has to be modified: 1) Add bodyParser to the required modules by inserting: var bodyparser = require('body-parser');

2) Replace the complete block: app.configure(function() { // used to parse JSON object given in the body request app.use(express.bodyParser()); }); with: app.use(bodyparser.urlencoded({ extended: false })); app.use(bodyparser.json());

That's all. I close this issue.

wolfgangmauerer commented 9 years ago

Reopening -- please send a patch with your changes and update the documentation so that the issue is also solved for other users, not just for your installation. Then close the issue.

We can require a minimum version of nodejs that implements the required API so that we get rid of the problem for good.

mitchell-joblin commented 9 years ago

Fixed.