HorseAJ86 / node-jquery

jQuery with a thin wrapper for Ender.JS, Node.JS, and other npm-based packaging systems
http://jquery.com
MIT License
431 stars 66 forks source link

Error when requiring module in repl mode #27

Closed lfortin closed 12 years ago

lfortin commented 12 years ago

Doing:

var $ = require('jquery');

causes error in repl mode.

Seems to happen when modules 'location' and 'navigator' are not installed.

Adding 'location' and 'navigator' in package.json dependencies could fix the problem?

treasonx commented 12 years ago

This is interesting.

Is this on a windows system?

tao-du commented 12 years ago

I encountered this error also, on a windows OS, and after installed those 2 modules I got this stack,

var $ = require('jQuery'); TypeError: Cannot read property 'userAgent' of undefined at C:\svr\node_modules\jQuery\lib\node-jquery.js:87:23 at C:\svr\node_modules\jQuery\lib\node-jquery.js:995:2 at create (C:\svr\node_modules\jQuery\lib\node-jquery.js:9416:2) at C:\svr\node_modules\jQuery\lib\node-jquery.js:9422:18 at Object. (C:\svr\node_modules\jQuery\lib\node-jquery.js:9424:1)

at Module._compile (module.js:446:26)
at Object..js (module.js:464:10)
at Module.load (module.js:353:31)
at Function._load (module.js:311:12)
at Module.require (module.js:359:17)
coolaj86 commented 12 years ago

Note the difference between jquery and jQuery in npm. I believe the jquery branch has been dropped in favor of jQuery.

Previously jQuery worked with ender and jquery worked with node.

I've stopped using any of the jQuery in favor of ender, plus since they updated ender to require from the browser global the vanilla jQuery (non-npm) now works with ender.

Perhaps jquery should be have an update with a deprecation notice?

lfortin commented 12 years ago

If you say that 'jquery' is no longer used as opposed to 'jQuery', it would be nice to flag it as deprecated, because on npm registry, there are almost 40 packages that depend on 'jquery'; only 10 packages or so depend on 'jQuery'.

Then, my plugin(for instance, jQuery Drive) should depend on 'jQuery' rather than 'jquery'?

lfortin commented 12 years ago

I think I know why... I did not have g++ installed... Sorry, my mistake.