Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

ThreeNodes.js / NodeJS / CoffeeScript - Error During Build to Static JS

ThreeNodes.js / NodeJS / CoffeeScript - Error During Build to Static JS


I ran server.js with node and everything worked perfectly. It's when I try to run the build script to create a compiled static version. I should also mention that it does output most of the files, but then throws an Error mid-way.

I ran:

node server.js build

It seemed to work fine until it got to "Starting to Optimize the javascripts..."

Error Output:

                throw new Error(errorMsg);
Error: TypeError: Object function () {
            //A version of a require function that passes a moduleName
            //value for items that may need to
            //look up paths relative to the moduleName
            var args =, 0), lastArg;
            if (enableBuildCallback &&
                    isFunction((lastArg = args[args.length - 1]))) {
                lastArg.__requireJsBuild = true;
            return func.apply(null, args);
        } has no method 'nameToUrl'
In module tree:

    at Object.load (eval at  (/root/threenodes/ThreeNodes.js/node_modules/requirejs/bin/r.js:13687:38))
Problem courtesy of: Timothy Perez


I've just committed a fix to threenodes.js which should resolve your issue. It was caused by the fact that requirejs has been updated and the !order plugin is now deprecated. So the fix was simply to define a more precise version of requirejs in package.json.

To fix it:

  • git pull origin master
  • npm install -d
  • node server.js build

As a side note, the dev branch use the new version of requirejs. It's still not merged on master because I've started to work on "node grouping" but it is not finished yet. Apart from this all other functionality should work the same way as on the master branch. So if you plan to develop something on top of threenodes I would recommend to use the dev branch ; ]

Solution courtesy of: idFlood


View additional discussion.

This post first appeared on Node.js Recipes, please read the originial post: here

Share the post

ThreeNodes.js / NodeJS / CoffeeScript - Error During Build to Static JS


Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription