mongodb - Node.js Module Function are not exported after ubuntu 16 upgrade from 14 -


i upgraded ubuntu 14 lts 16 while using node.js server have wrapper class transaction table in mongo database. these functions referred in main server file crud operations. when upgraded ubuntu 14 ubuntu 16 earlier morning. started giving me following error these wrapper class functions.

typeerror: recipedata.getallusers not function 

where getallusers function has mongo queries being used in server class in api's. , recipedata main folder index.js(actual wrapper class) table. folder structure :

-recipe-data ---config.js ---index.js (wrapper class) ---package.js (main class set whenever module referred index.js read) ---recipecollection.js -recipe-server ---routes ------index.js (this server main) ---package.js 

following structure of wrapper class. index.js

var mongoclient = require('mongodb').mongoclient, settings = require('./config.js');  var objectid = require('mongodb').objectid;  var fullmongourl = settings.mongoconfig.serverurl +     settings.mongoconfig.database; var exports = module.exports = {};  mongoclient.connect(fullmongourl)     .then(function(db) {    exports.delete_user = function(uuid) {         console.log('@ data delete user uuid : ' + uuid);         return usercollection.remove({ id: uuid }, 1).then(             function(param) {                 console.log('delete operation result : ' + json.stringify(param));                 return { status: 'success', result: param };             },             function(err) {                 return { status: 'failure', error: err };             }         );     }  }); 

recipe-server : index.js (main file) follows

 const recipedata = require("../../recipe-data");   router.get('/users',(req,res){      // code      >>> recipedata.getallusers().then(function(users) {      error : typeerror: recipedata.getallusers not function   }); 

recipe-data -- > package.js

{   "name": "recipe-data",   "version": "1.0.0",   "description": "data recipe portion of our website",   "main": "index.js",   "scripts": {          "test": "echo \"error: no test specified\" && exit 1",          "seed": "node ./tasks/seed.js"         },   "author": "phil barresi",   "license": "mit",   "dependencies": {   "bluebird": "^3.4.6",   "mongodb": "^2.2.10"  } } 

recipe-server --> package.json

 {   "name": "cs-554",   "version": "1.0.0",   "description": "a small demo electron application",   "main": "main.js",   "scripts": {              "start": "node app.js"     },   "productname": "cs-554",   "repository": {   "type": "git",   "url": "git+https://github.com/stevens-cs546/cs-554"   },   "keywords": [    "quick",    "start",    "tutorial"    ],   "author": "github",   "license": "cc0-1.0",   "bugs": {   "url": "https://github.com/stevens-cs546/cs-554/issues"  },   "homepage": "https://github.com/stevens-cs546/cs-554#readme",   "devdependencies": {   "babel-preset-es2015": "^6.14.0",   "babel-preset-react": "^6.11.1",   "gulp": "^3.9.1",   "gulp-autoprefixer": "^3.1.1",   "gulp-babel": "^6.1.2",   "gulp-clean-css": "^2.0.12",   "gulp-concat": "^2.6.0",   "gulp-sass": "^2.3.2",   "gulp-sourcemaps": "^1.6.0"  },   "dependencies": {   "bcrypt-nodejs": "0.0.3",   "bluebird": "^3.4.6",   "body-parser": "^1.15.2",   "express": "^4.14.0",   "express-handlebars": "^3.0.0",   "handlebars": "^4.0.5",   "jsonwebtoken": "^7.1.9",   "mongodb": "^2.1.18",   "node-redis-pubsub": "^0.9.0",   "node-uuid": "^1.4.7",   "xss": "^0.2.13"  } }  


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -