【问题标题】:Working with compound js on windows. Cannot start anything在 Windows 上使用复合 js。无法启动任何东西
【发布时间】:2013-03-13 02:24:19
【问题描述】:

我希望使用 compound.js 创建一个 hello world 应用程序。
到目前为止,根本没有任何效果。
我已经安装了“npm install Compound -g”,让化合物在全球范围内可用。
现在我想运行“compound init”,我得到了这个:

(见第一个代码块)

在谷歌搜索时,我在 npm 上找到了一个名为 mongoose-compound-example-app 的示例应用程序。
在 npm 安装之后,我运行了“node”。按照自述文件中的建议:

(见第二个代码块)
我正在使用 Windows 8 x64。 Node 本身可以工作,而且我已经能够使用locomotive.js 运行“hello world”应用程序。我真的很想弄明白化合物并开始工作,但我似乎什么也做不到。

提前谢谢你!

编辑: 我正在使用节点 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 错误:

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

【问题讨论】:

  • 您可以粘贴错误消息的实际文本,而不是屏幕截图吗?你使用的是什么版本的 Node.js?
  • 完成。 Node 0.10.0刚出来,你觉得compound不兼容吗?
  • 可能。我昨晚安装了 v.10 并且一堆东西坏了。由于 Compound 指定了 v.8,因此我建议您尝试一下,看看问题是否会消失。
  • 我已经安装了 0.8,现在我遇到了不同的错误
  • 听起来 Compound 需要一些更新。

标签: windows node.js express railway.js compoundjs


【解决方案1】:

作为discussed in the chat,您使用的Node.js版本似乎有问题或冲突。

Compound 的 package.json 表示它需要 Node.js 0.8.0 或更高版本。您提到它在 0.9 中有效,但在 0.10 中无效。这可能是一个错误,因为 Node 的奇数版本通常是在后来的偶数稳定版本之前的不稳定版本。

我建议在 Compound 的错误跟踪器上发布一个可重现的示例,如果可以将其缩小到 Node 问题,还可以发布 Node.js。

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2019-02-28
  • 2012-09-06
  • 2021-05-02
  • 2014-06-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多