Closed
Description
I'm trying to integrate node-postgress to my meteor application but I'm getting some errors, when I try to run the app.
First errors
node_modules/pg/script/setup-bench-data.js:3:3: Unexpected token .
File
var pg = require('../lib');
var
pg.connect(function(err, client) {
})
I delete the extra "var" and it works
var pg = require('../lib');
pg.connect(function(err, client) {
})
Then:
W20140324-12:49:25.508(-6)? (STDERR) /Users/crowdint/.meteor/tools/8e197f29c5/lib/node_modules/fibers/future.js:173
W20140324-12:49:25.509(-6)? (STDERR) throw(ex);
W20140324-12:49:25.509(-6)? (STDERR) ^
W20140324-12:49:25.513(-6)? (STDERR) ReferenceError: exports is not defined
W20140324-12:49:25.514(-6)? (STDERR) at app/node_modules/pg/node_modules/generic-pool/lib/generic-pool.js:99:1
W20140324-12:49:25.514(-6)? (STDERR) at app/node_modules/pg/node_modules/generic-pool/lib/generic-pool.js:469:3
W20140324-12:49:25.514(-6)? (STDERR) at /Users/crowdint/projects/kardex/.meteor/local/build/programs/server/boot.js:155:10
W20140324-12:49:25.515(-6)? (STDERR) at Array.forEach (native)
W20140324-12:49:25.515(-6)? (STDERR) at Function._.each._.forEach (/Users/crowdint/.meteor/tools/8e197f29c5/lib/node_modules/underscore/underscore.js:79:11)
W20140324-12:49:25.517(-6)? (STDERR) at /Users/crowdint/projects/kardex/.meteor/local/build/programs/server/boot.js:82:5
file:
exports.Pool = function (factory) {
var me = {},
….
and I did this:
exports = typeof exports === "undefined" ? {} : exports
exports.Pool = function (factory) {
var me = {},
…
then:
W20140324-12:57:58.598(-6)? (STDERR) /Users/crowdint/.meteor/tools/8e197f29c5/lib/node_modules/fibers/future.js:173
W20140324-12:57:58.598(-6)? (STDERR) throw(ex);
W20140324-12:57:58.599(-6)? (STDERR) ^
W20140324-12:57:58.602(-6)? (STDERR) ReferenceError: require is not defined
W20140324-12:57:58.602(-6)? (STDERR) at app/node_modules/pg/node_modules/pgpass/lib/helper.js:3:12
W20140324-12:57:58.602(-6)? (STDERR) at app/node_modules/pg/node_modules/pgpass/lib/helper.js:232:3
W20140324-12:57:58.603(-6)? (STDERR) at /Users/crowdint/projects/kardex/.meteor/local/build/programs/server/boot.js:155:10
W20140324-12:57:58.603(-6)? (STDERR) at Array.forEach (native)
W20140324-12:57:58.604(-6)? (STDERR) at Function._.each._.forEach (/Users/crowdint/.meteor/tools/8e197f29c5/lib/node_modules/underscore/underscore.js:79:11)
W20140324-12:57:58.604(-6)? (STDERR) at /Users/crowdint/projects/kardex/.meteor/local/build/programs/server/boot.js:82:5
file:
var path = require('path')
, Stream = require('stream').Stream
, Split = require('split')
, util = require('until')
I change it to:
var path = Npm.require('path')
, Stream = Npm.require('stream').Stream
, Split = Npm.require('split')
, util = Npm.require('util')
But I'm still getting this errors....
W20140324-13:00:53.582(-6)? (STDERR) /Users/crowdint/.meteor/tools/8e197f29c5/lib/node_modules/fibers/future.js:173
W20140324-13:00:53.583(-6)? (STDERR) throw(ex);
W20140324-13:00:53.583(-6)? (STDERR) ^
W20140324-13:00:53.587(-6)? (STDERR) ReferenceError: module is not defined
W20140324-13:00:53.587(-6)? (STDERR) at app/node_modules/pg/node_modules/pgpass/lib/helper.js:40:23
W20140324-13:00:53.588(-6)? (STDERR) at app/node_modules/pg/node_modules/pgpass/lib/helper.js:232:3
W20140324-13:00:53.588(-6)? (STDERR) at /Users/crowdint/projects/kardex/.meteor/local/build/programs/server/boot.js:155:10
W20140324-13:00:53.588(-6)? (STDERR) at Array.forEach (native)
W20140324-13:00:53.588(-6)? (STDERR) at Function._.each._.forEach (/Users/crowdint/.meteor/tools/8e197f29c5/lib/node_modules/underscore/underscore.js:79:11)
W20140324-13:00:53.589(-6)? (STDERR) at /Users/crowdint/projects/kardex/.meteor/local/build/programs/server/boot.js:82:5
file:
Object.defineProperty(module.exports, 'isWin', {
get : function() {
return isWin;
} ,
set : function(val) {
isWin = val;
}
});
I guess they are because of the way the file are being loaded, but I'm not sure.
Does somebody has any idea about what could I do?
I'll really appreciate it.
Metadata
Metadata
Assignees
Labels
No labels