When i generate a project using express it throw commas instead of newlines
example: express my_project
generate this in a single line
,/**, * Module dependencies., */,,var express = require('express'), , routes = require('./routes'), , user = require('./routes/user'), , http = require('http'), , path = require('path');,,var app = express();,,
instead of
/**
* Module dependencies.
*/
var express = require('express'),
routes = require('./routes'),
user = require('./routes/user'),
http = require('http'),
path = require('path');
var app = express();
every file generated by express has the same format
How i prevent this?
Thanks!
If you check inside the build file you have:
var eol = os.EOL
You then have:
var app = [
''
, '/**'
, ' * Module dependencies.'
, ' */'
, ''
, 'var express = require(\'express\')'
, ' , routes = require(\'./routes\')'
, ' , user = require(\'./routes/user\')'
...
...
].join(eol);
That's what being written into app.js.
If this doesn't work for you try replacing that with what express previously had:
var eol = 'win32' == os.platform() ? '\r\n' : '\n'
I had the same issue. Express 3.1.0 worked and then 3.1.1 and every subsequent Express version is broken.
But this turned out to be a bug in the Node.js for Windows build that was fixed in a very recent version of Node.js. Uninstall Node.js, navigate to http://nodejs.org/, and click on Install to download the latest installer.