Don't have time to provide a proper repro now but the basic issue can be illustrated by this:
`
~/c/boot-cljs-example (master=) node target/main.js
module.js:338
throw err;
^
Error: Cannot find module '/Users/martin/code/boot-cljs-example/out/goog/bootstrap/nodejs.js'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/Users/martin/code/boot-cljs-example/target/main.js:6:1)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
~/c/boot-cljs-example (master=) cd target/
~/c/b/target (master=) node main.js
Starting...
`
This is compiled with boot because that was what I had at hand right now. The compiled shim looks like this:
`
var path = require("path");
try {
require("source-map-support").install();
} catch(err) {
}
require(path.join(path.resolve("."),"out","goog","bootstrap","nodejs.js"));
require(path.join(path.resolve("."),"out","cljs_deps.js"));
goog.global.CLOSURE_UNCOMPILED_DEFINES = {"cljs.core._STAR_targetSTAR":"nodejs"};
goog.require("boot.cljs.main");
goog.require("cljs.nodejscli");
`
The problem here is that {{path.resolve(".")}} will return the directory the {{node}} command was invoked in and not the directory of the shim. (See the "Cannot find module..." error above)
A solution could be to use {{__dirname}} which always resolves to the directory of the current file. This might result in some breakage for existing setups.