fordth / jinqJs

jinqJs provides a simple way to perform SQL like queries on javaScript arrays, collections and web services using LINQ expressions.
Other
93 stars 29 forks source link

Node: Cannot find module 'jinq' #12

Closed exejutable closed 8 years ago

exejutable commented 8 years ago

I do a install of jinq sudo npm install -g jinq and npm install jinq in both set the variable var jinqJs = require('jinq'); , when i run my app node returns

Error: Cannot find module 'jinq' at Function.Module._resolveFilename (module.js:339:15) at Function.Module._load (module.js:290:25) at Module.require (module.js:367:17) at require (internal/module.js:16:19) at Object.<anonymous> (/var/www/html/JobAdminApi/src/models/ymlGenerator.js:18:14) at Module._compile (module.js:413:34) at Object.Module._extensions..js (module.js:422:10) at Module.load (module.js:357:32) at Function.Module._load (module.js:314:12) at Module.require (module.js:367:17)

I create a clean project only with var jinqJs = require('jinq'); and returns the same error. The version is "jinq": "1.5.9",

fordth commented 8 years ago

Try this, this worked for me.

//npm install jinq For Local //npm install -g jinq For Global

//var jinqJs = require('./node_modules/jinq'); //Local var jinqJs = require('jinq'); //Global

var data = [{Name: 'Tom'}, {Name: 'Frank'}]

var results = new jinqJs().from(data).select();

console.log(results);

exejutable commented 8 years ago

what is your node v?

fordth commented 8 years ago

Sorry for the delay, v4.2.4