Question

I wish to create a hello world application using compound.js.
So far, nothing works at all.
I've installed "npm install compound -g" to have compound be available globally.
Now I wish to run "compound init" and I get this:

(see first code block)

While googling, I found an example app on npm called mongoose-compound-example-app.
After npm installing that, I ran "node ." as suggested in the readme:

(see second code block)
I am using Windows 8 x64. Node itself works, and I've been able to run a "hello world" application using locomotive.js. I really want to get compound figured out and working, but I can't seem to get anywhere at all.

Thank you in advance!

EDIT: I am using Node v0.10.0

C:\Users\Lev\test>compound init hello

path.js:204
    throw new TypeError('Arguments to path.join must be strings');
          ^
TypeError: Arguments to path.join must be strings
at f (path.js:204:15)
at Object.filter (native)
at Object.exports.join (path.js:209:40)
at CompoundServer.module.exports [as extensions]      (C:\Users\Lev\AppData\Roaming\npm\node_modules\compound\lib\server\extensions.js:13:25)
at CompoundServer.initCompound (C:\Users\Lev\AppData\Roaming\npm\node_modules\compound\lib\compound.js:100:14)
at CompoundServer.init (C:\Users\Lev\AppData\Roaming\npm\node_modules\compound\lib\server\compound.js:42:29)
at C:\Users\Lev\AppData\Roaming\npm\node_modules\compound\lib\compound.js:61:18
at process._tickCallback (node.js:415:13)
at Function.Module.runMain (module.js:499:11)
at startup (node.js:119:16)
at node.js:903:3

mongoose-compound-example-app error:

C:\Projects\mongoose-compound-example-app\config\environment.js:11
    app.use(compound.assetsCompiler.init());
                                    ^
TypeError: Cannot call method 'init' of undefined
at Function.<anonymous> (C:\Projects\mongoose-compound-example-app\config\environment.js:11:41)
at Function.app.configure (C:\Projects\mongoose-compound-example-app\node_modules\express\lib\application.js:396:61)
at module.exports (C:\Projects\mongoose-compound-example-app\config\environment.js:10:9)
at evalInContextOf (C:\Projects\mongoose-compound-example-app\node_modules\compound\lib\compound.js:187:9)
at requireIfExists (C:\Projects\mongoose-compound-example-app\node_modules\compound\lib\compound.js:165:9)
at configureApp (C:\Projects\mongoose-compound-example-app\node_modules\compound\lib\compound.js:147:5)
at CompoundServer.initCompound (C:\Projects\mongoose-compound-example-app\node_modules\compound\lib\compound.js:91:9)
at CompoundServer.init (C:\Projects\mongoose-compound-example-app\node_modules\compound\lib\server\compound.js:42:29)
at C:\Projects\mongoose-compound-example-app\node_modules\compound\lib\compound.js:61:18
at process._tickCallback (node.js:415:13)
at Function.Module.runMain (module.js:499:11)
at startup (node.js:119:16)
at node.js:903:3
Was it helpful?

Solution

As discussed in the chat, there seems to be a problem or conflict with the version of Node.js you are using.

Compound's package.json says that it expects Node.js 0.8.0 or higher. You mentioned that it works in 0.9, but not in 0.10. This is likely a bug, as the odd-numbered versions of Node are typically the unstable versions before the later even number stable releases.

I recommend posting a reproducible example on the bug tracker for Compound, and possibly Node.js if you can narrow it down to a Node issue.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top