cram failed: Cannot find module '/usr/lib/node_modules/cram/amd_modules/curl/src/curl/../../dist/curl-for-ssjs/curl.js'

68 views
Skip to first unread message

Bulat Sh

unread,
Nov 8, 2013, 12:51:46 PM11/8/13
to cuj...@googlegroups.com
Hi everyone! 

I've built my first js app using curl,  curl works really well,  and now trying to bundle my whole app into single file for production. 
I've installed cram globally with npm install -g cram
and then I'm running it with 
cram admin2.html
and then it fails:

cram failed:  Cannot find module '/usr/lib/node_modules/cram/amd_modules/curl/src/curl/../../dist/curl-for-ssjs/curl.js'
Error: Cannot find module '/usr/lib/node_modules/cram/amd_modules/curl/src/curl/../../dist/curl-for-ssjs/curl.js'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at /usr/lib/node_modules/cram/cram.js:55:4
    at /usr/lib/node_modules/cram/cram.js:629:85
    at /usr/lib/node_modules/cram/cram.js:13:1
    at Object.<anonymous> (/usr/lib/node_modules/cram/cram.js:625:2)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)

This is my config in admin2.html

curl({
        baseUrl: "../static/js",
        paths: {
            "jquery": "jquery.min.js",
            "underscore": "lodash.min.js",
            "backbone": {
                location: "backbone-min.js",
                config: {
                    loader: "curl/loader/legacy",
                    exports: "Backbone.noConflict()",
                    requires: ["jquery", "underscore"]
                }
            },
            "marionette": "backbone.marionette.min.js",
            "styles": "../css",
            "bundles": "../../templates/bundles",
            "alertify": "alertify.min.js"
        }
    }, ["app/app", "app/util", "app/admin"]).then(function(app, util){
            app.start()
    })

I need your help to make this work. Thanks!

Skylar Durst

unread,
Nov 14, 2013, 11:30:16 PM11/14/13
to cuj...@googlegroups.com
you need to call bower install in the node_modules...

since you're on a global config you'll have to cd to your global node_modules.

But if you did an npm install to your local folders:

cd node_modules/cram
bower install

... and you're good!

John Hann

unread,
Nov 16, 2013, 7:56:35 PM11/16/13
to cuj...@googlegroups.com
Thanks Skylar. 

Bulat: sorry about that. we're about to release a fix so you don't have to type `bower install`. 

-- John

Sent from planet earth
--
You received this message because you are subscribed to the Google Groups "cujojs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cujojs+un...@googlegroups.com.
To post to this group, send email to cuj...@googlegroups.com.
Visit this group at http://groups.google.com/group/cujojs.
To view this discussion on the web visit https://groups.google.com/d/msgid/cujojs/f6c2b70e-c565-4166-b767-d2c8df63d769%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Bulat Sh

unread,
Nov 17, 2013, 2:16:36 PM11/17/13
to cuj...@googlegroups.com
> you need to call bower install in the node_modules/cram
Great, its working.  this is really Frankenstein's "he's alive. He's alive!" moment :)

Thanks, guys.  It's really important for me to make cram work, because my app is about 8200 lines in coffeescript already yet it's not finished, and I'm going to have quite a few users with mobile devices. That's why I'm going to pack all my js files up into a single bundle.
Reply all
Reply to author
Forward
0 new messages