1

我正在关注 geddy教程

我使用 npm 安装 geddy & jake,创建应用程序,cd 进入创建的文件夹,然后运行 ​​geddy 命令。但是在运行 geddy 命令时出现错误,这是我的完整输出:

martin@crunchbang:~/code$ npm install geddy jake -g
/usr/local/bin/jake -> /usr/local/lib/node_modules/jake/bin/cli.js
/usr/local/bin/geddy -> /usr/local/lib/node_modules/geddy/bin/cli.js
jake@0.2.33 /usr/local/lib/node_modules/jake 
geddy@0.4.1 /usr/local/lib/node_modules/geddy 
martin@crunchbang:~/code$ geddy app geddy_todo
Created app geddy_todo.
martin@crunchbang:~/code$ cd geddy_todo/
martin@crunchbang:~/code/geddy_todo$ geddy

node.js:201
    throw e; // process.nextTick error, or 'error' event on first tick
          ^
TypeError: Object #<Object> has no method 'addListener'
at [object Object].<anonymous>           (/usr/local/lib/node_modules/geddy/lib/cluster/master.js:25:11)
at /usr/local/lib/node_modules/geddy/bin/cli.js:109:9
at Object.<anonymous> (/usr/local/lib/node_modules/geddy/bin/cli.js:181:5)
at Module._compile (module.js:432:26)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Array.0 (module.js:470:10)
at EventEmitter._tickCallback (node.js:192:40)
martin@crunchbang:~/code/geddy_todo$ 

运行这些命令后,无论我在哪里运行,geddy 命令似乎都被破坏了,我得到以下信息:

martin@crunchbang:~$ geddy

node.js:201
    throw e; // process.nextTick error, or 'error' event on first tick
          ^
TypeError: Object #<Object> has no method 'addListener'
at [object Object].<anonymous> (/usr/local/lib/node_modules/geddy/lib/cluster/master.js:25:11)
at /usr/local/lib/node_modules/geddy/bin/cli.js:109:9
at Object.<anonymous> (/usr/local/lib/node_modules/geddy/bin/cli.js:181:5)
at Module._compile (module.js:432:26)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Array.0 (module.js:470:10)
at EventEmitter._tickCallback (node.js:192:40)

当我运行时:

npm rm geddy jake

我明白了

martin@crunchbang:~$ sudo npm rm geddy jake
npm WARN Not installed in /home/martin/node_modules geddy
npm WARN Not installed in /home/martin/node_modules jake

我不确定接下来要尝试什么才能使其正常工作?

4

1 回答 1

2

听起来您没有安装最新版本的 node 和 npm。我不能肯定,但尝试卸载 node 和 npm 并从http://nodejs.org重新安装最新版本。

您需要确保将 Geddy 和 Jake 安装为全局包。

npm install -g geddy jake
于 2012-05-31T19:08:34.543 回答