Difficulties with jQuery dependency

58 views
Skip to first unread message

Luis Fernando Urrea

unread,
Dec 8, 2012, 1:07:56 PM12/8/12
to spi...@googlegroups.com
Hi all,

I am trying to give spine.js a spin but I am having difficulties when including jQuery as a dependency. Basically I reference "jquery": "~1.8.3" in package.json and "jquery" in slug.json, then I run npm install .

Fire up hem server, but when I load my app it crashes on me with the following output:

 /usr/local/lib/node_modules/hem/lib/resolve.js:43
      throw "Cannot find module: " + request + ". Have you run `npm install .`
                                             ^
Cannot find module: url. Have you run `npm install .` ?


This seems to be related to module "url", but I have tried to manually install it using npm both locally and even globally and is still failing in the same way. I have also included jquery under lib instead and it gives the same results.

I appreciate your help.

Luis Fernando Urrea

unread,
Dec 8, 2012, 2:27:56 PM12/8/12
to spi...@googlegroups.com
Trying to debug this I see that:

The call to Module._findPath(request, paths) returns false being request = "url" and paths= "." and Module._findPath a call from a library in node.js

Luis Fernando Urrea

unread,
Dec 9, 2012, 12:32:37 PM12/9/12
to spi...@googlegroups.com
I installed Hem version0_2 as described on the post below this one but it still giving me the same.

Either this project is made for seasoned js developers or it's still alpha quality or the documentation is just wrong or I am just plain stupid. In any case it's been too much frustration for such short a life span we humans have.

Chris Engebretson

unread,
Dec 12, 2012, 7:27:49 PM12/12/12
to spi...@googlegroups.com
I believe the node npm version of jquery that is usable in spine is called "jqueryify". The full version in my package.json is 

"jqueryify": "~0.0.3"

To know for sure that its installed you can check your node_modules folder to see if a jqueryify folder exists. And then make sure to have "jqueryify" in your slug.json for it to be compiled into the single application.js file that hem creates. At least that is the simplest approach to getting jquery/spine working together. 

Hope that helps,
chris

Miles Matthias

unread,
Dec 5, 2013, 5:57:09 PM12/5/13
to spi...@googlegroups.com
So any npm module that doesn't rely on node isn't usable in spine? That doesn't seem to make sense. I'm confused about which npm modules you can use and you can't. I'm just trying to use fastclick - an npm module that doesn't have any dependencies and hem can't find it.
Reply all
Reply to author
Forward
0 new messages