2012-03-06 111 views
2

安装iodocs我this problem开始,所以我试图在Linux上

npm install --force 

看来工作,只有一个警告:

npm WARN [email protected] package.json: bugs['web'] should probably be bugs['url'] 

但是当我尝试运行它,它给了我:

[[email protected] iodocs]$ node ./app.js 
The "sys" module is now called "util". It should have a similar interface. 

node.js:201 
     throw e; // process.nextTick error, or 'error' event on first tick 
      ^
Error: Cannot find module 'hashlib' 
    at Function._resolveFilename (module.js:332:11) 
    at Function._load (module.js:279:25) 
    at Module.require (module.js:354:17) 
    at require (module.js:370:17) 
    at Object.<anonymous> (/home/ec2-user/iodocs/app.js:37:19) 
    at Module._compile (module.js:441:26) 
    at Object..js (module.js:459:10) 
    at Module.load (module.js:348:31) 
    at Function._load (module.js:308:12) 
    at Array.0 (module.js:479:10) 

我不知道该如何处理它,请给我一些启示。

顺便说一句,我试图在Linux 2.6.35.14-97.44.amzn1.x86_64 EC2实例上安装iodocs

===========================更新================== ==============================

我也试过在Heroku上安装它,但遇到同样的问题:

-----> Heroku receiving push 
-----> Node.js app detected 
-----> Resolving engine versions 
     Using Node.js version: 0.6.12 
     Using npm version: 1.0.106 
-----> Fetching Node.js binaries 
-----> Vendoring node into slug 
-----> Installing dependencies with npm 
     npm WARN [email protected] package.json: bugs['web'] should probably be bugs['url'] 
     npm ERR! Unsupported 
     npm ERR! Not compatible with your version of node/npm: [email protected] 
     npm ERR! Required: {"node":"0.4.x","teleport":">=0.2.0"} 
     npm ERR! Actual: {"npm":"1.0.106","node":"0.6.12"} 
     npm ERR! 
     npm ERR! System Linux 2.6.32-342-ec2 
     npm ERR! command "/tmp/node-node-kXeE/bin/node" "/tmp/node-npm-1IT8/cli.js" "install" 
     npm ERR! cwd /tmp/build_3mjp7psqka071 
     npm ERR! node -v v0.6.12 
     npm ERR! npm -v 1.0.106 
     npm ERR! code ENOTSUP 

     > [email protected] preinstall /tmp/build_3mjp7psqka071/node_modules/hashlib 
     > node-waf clean || true; node-waf configure build 

     npm ERR! 
     npm ERR! Additional logging details can be found in: 
     npm ERR!  /tmp/build_3mjp7psqka071/npm-debug.log 
     npm not ok 
     Nothing to clean (project not configured) 
     Checking for program g++ or c++   : /usr/bin/g++ 
     Checking for program cpp     : /usr/bin/cpp 
     Checking for program ar     : /usr/bin/ar 
     Checking for program ranlib    : /usr/bin/ranlib 
     Checking for g++       : ok 
     Checking for program gcc or cc   : /usr/bin/gcc 
     Checking for gcc       : ok 
     Checking for node path     : not found 
     Checking for node prefix     : ok /tmp/node-node-kXeE 
     'configure' finished successfully (0.476s) 
     Waf: Entering directory `/tmp/build_3mjp7psqka071/node_modules/hashlib/build' 
     [1/6] cc: libhash/md4c.c -> build/Release/libhash/md4c_1.o 
     [2/6] cc: libhash/md5c.c -> build/Release/libhash/md5c_1.o 
     [3/6] cc: libhash/sha0c.c -> build/Release/libhash/sha0c_1.o 
     [4/6] cxx: hashlib.cc -> build/Release/hashlib_2.o 
     ../hashlib.cc:14:16: error: ev.h: No such file or directory 
     ../hashlib.cc:15:17: error: eio.h: No such file or directory 
     ../hashlib.cc:311: error: 'eio_req' was not declared in this scope 
     ../hashlib.cc:311: error: 'req' was not declared in this scope 
     ../hashlib.cc:312: error: expected ',' or ';' before '{' token 
     Waf: Leaving directory `/tmp/build_3mjp7psqka071/node_modules/hashlib/build' 
     Build failed: -> task failed (err #1): 
     {task: cxx hashlib.cc -> hashlib_2.o} 
!  Failed to install dependencies with npm 
!  Heroku push rejected, failed to compile Node.js app 

回答

2

我碰到了同样的问题。

我觉得有一个“拉入请求”可能会解决这个问题: https://github.com/mashery/iodocs/pull/14

我要实现它,如果它的工作原理,将报告。

编辑:

我能得到更远。这里有一些事情你需要做的:

  1. 实现上述
  2. 中的package.json挂拉入请求,更新"express": "2.5.8"(版本它们2.4.8不与node.js的V1兼容.0.0
  3. 从 “iosdocs/node_modules”

npm install现在应该工作。

删除 “hashlib” 目录然而,如果你运行node ./app.js,我得到这个错误:

The "sys" module is now called "util". It should have a similar interface. Express server listening on port 3000

node.js:201 throw e; // process.nextTick error, or 'error' event on first tick

编辑#2:

想通了!你必须实际运行redis-server(DUH)。

所以我做了以下内容:

  1. Download redis 2.4.8 from their site
  2. 按照他们的解压指导,建设
  3. src/redis-server

巴姆运行服务器,现在运行node ./app.js和它的作品!

0

我碰到hashlib相同的模块错误。排除故障后,我擦拭了iodocs文件夹并使用jsonmccreary's fork of iodocs代替。

克隆回购后,这里就是我所做的:

  1. npm install
  2. 安装Redis的服务器sudo apt-get install redis-server
  3. 开始运行Redis的服务器 '的Redis服务器'

现在,运行node ./app.js作品!

编辑:

贾森谈论一些问题的Heroku配置为iodocs on his blog这是我发现他的叉子从。