duojs / duo

A next-generation package manager for the front-end
3.42k stars 118 forks source link

error during installing Emscripten box2d #508

Closed michahell closed 8 years ago

michahell commented 8 years ago

just an index.js file with:

var box2d = require('kripken/box2d.js');

gives me the error:

building : index.js
        using : compatibility
        using : stoj
        error : TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at extname (path.js:1429:5)
    at extension (/usr/local/lib/node_modules/duo/node_modules/duo-main/index.js:135:10)
    at dependency (/usr/local/lib/node_modules/duo/node_modules/duo-main/index.js:83:16)
    at coerce (/usr/local/lib/node_modules/duo/node_modules/duo-main/index.js:31:7)
    at Duo.resolve (/usr/local/lib/node_modules/duo/lib/duo.js:852:22)
    at next (native)
    at next (/usr/local/lib/node_modules/duo/node_modules/co/index.js:74:21)
    at Duo.<anonymous> (/usr/local/lib/node_modules/duo/node_modules/co/index.js:45:5)
    at Duo.next (/usr/local/lib/node_modules/duo/node_modules/co/index.js:90:21)
    at Duo.<anonymous> (/usr/local/lib/node_modules/duo/node_modules/co/index.js:93:18)
    at Immediate._onImmediate (/usr/local/lib/node_modules/duo/node_modules/co/index.js:52:14)
    at tryOnImmediate (timers.js:543:15)
    at processImmediate [as _immediateCallback] (timers.js:523:5)

maybe / probably because that repo doesn't seem to cohere to any standard 📦 format ?

dominicbarnes commented 8 years ago

@michahell: you're right, it's not using any package format understood by duo. (ie: no component.json, no index.js, etc)

You can specify a JS path via: kripken/box2d.js:build/Box2D_v2.3.1_min.js (you may want to specify a git commit sha so the rug doesn't get pulled out from under you if they change versions or something)

michahell commented 8 years ago

Oh wow that is some awesome stuff, I expected there was a way to do something like that! my (ugly) workaround was to pull the three files that I needed into a /libs and then require those by hand, but that is even nicer! thanks!