2012-02-25 15 views
2

TLDR:節點應用在本地工作,在Nodester.com上不起作用,似乎是npm問題。在Nodester上使用bogart

詳細版本:

我寫了一個節點的應用與鮑嘉和CouchDB的(基本上遵循http://howtonode.org/bogart-couchdb),它運行正常本地

npm install bogart 
npm install couchdb 

安裝節點的擴展上本地Nodester,我通過CLI安裝它們作爲

nodester npm install bogart couchdb 

而且返回成功

現在我把我的工作代碼到Nodester.com回購並遇到了麻煩,腳本崩潰和日誌說

Error: Cannot find module 'zlib' 
at Function._resolveFilename (module.js:322:11) 
at Function._load (module.js:267:25) 
at require (module.js:351:19) 
at Object.<anonymous> (/node_modules/bogart/lib/middleware.js:67:16) 
at Function.<anonymous> (/node_modules/bogart/lib/middleware.js:781:15) 
at /node_modules/bogart/lib/bogart.js:162:35 
at Array.forEach (native) 
at App.start (/node_modules/bogart/lib/bogart.js:155:21) 
at Object.<anonymous> (/app/server.js:80:5) 
at Module._compile (module.js:407:26) 

在那之後,我試圖

nodester npm install zlib 

,它返回

nodester info installing these npm packages: zlib 
nodester > [email protected] preinstall /node/app/username/repo/node_modules/zlib 
nodester > node-waf clean || true; node-waf configure build 
nodester [email protected] ./node_modules/zlib 
nodester Nothing to clean (project not configured) 
nodester Setting srcdir to      : /node/app/username/repo/node_modules/zlib 
nodester Setting blddir to      : /node/app/username/repo/node_modules/zlib/build 
nodester Checking for program g++ or c++   : /usr/bin/g++ 
nodester Checking for program cpp     : /usr/bin/cpp 
nodester Checking for program ar     : /usr/bin/ar 
nodester Checking for program ranlib    : /usr/bin/ranlib 
nodester Checking for g++       : ok 
nodester Checking for node path     : not found 
nodester Checking for node prefix     : ok /usr 
nodester Checking for library z     : yes 
nodester 'configure' finished successfully (0.128s) 
nodester Waf: Entering directory `/node/app/username/repo/node_modules/zlib/build' 
nodester [1/2] cxx: src/node-zlib.cc -> build/default/src/node-zlib_1.o 
nodester ../src/node-zlib.cc: In function 'v8::Handle<v8::Value> ZLib_deflate(const v8::Arguments&)': 
nodester ../src/node-zlib.cc:82: warning: left-hand operand of comma has no effect 
nodester ../src/node-zlib.cc: In function 'v8::Handle<v8::Value> ZLib_inflate(const v8::Arguments&)': 
nodester ../src/node-zlib.cc:83: warning: left-hand operand of comma has no effect 
nodester [2/2] cxx_link: build/default/src/node-zlib_1.o -> build/default/zlib_bindings.node 
nodester Waf: Leaving directory `/node/app/username/repo/node_modules/zlib/build' 
nodester 'build' finished successfully (0.214s) 

看起來像是未完全安裝,但現在,由於服務器崩潰而不是503,它似乎開始。但現在的腳本拋出一個

An error occurred.Object # has no method 'createGzip' 
Stack Trace: 
TypeError: Object # has no method 'createGzip' at /node_modules/bogart/lib/middleware.js:88:33 at notify (/node_modules/bogart/node_modules/promised-io/lib/promise.js:181:22) at notifyAll (/node_modules/bogart/node_modules/promised-io/lib/promise.js:164:5) at /node_modules/bogart/node_modules/promised-io/lib/promise.js:205:3 at notify (/node_modules/bogart/node_modules/promised-io/lib/promise.js:181:22) at [object Object].then (/node_modules/bogart/node_modules/promised-io/lib/promise.js:234:4) at notify (/node_modules/bogart/node_modules/promised-io/lib/promise.js:183:17) at notifyAll (/node_modules/bogart/node_modules/promised-io/lib/promise.js:164:5) at [object Object]. (/node_modules/bogart/node_modules/promised-io/lib/promise.js:211:3) at /node_modules/bogart/lib/middleware.js:347:22 

對不起,文字的牆壁,但由於它在本地運行沒有任何問題,這是有點怪,數據庫連接和一切。

https://github.com/devongovett/pdfkit/issues/42

任何想法類似的問題?

+0

研究:問題固定在節點0.6.x.然而,nodester目前在0.4.x,所以我不得不坐下來。 – arvidkahl 2012-02-25 17:29:53

回答

0

在nodester devs的幫助下,我現在可以解釋爲什麼針對此問題的修復程序當前不可用

在版本的Node.js的ZLIB到0.6.x有時會導致問題(有關綁定)與某些節點模塊之前。這固定在0.6。嘗試通過npm在0.4.x上安裝pdfkit時會出現類似的問題。

然而,Nodester目前(這是2012年2月下旬)在0.4.9(ISH)運行,並且支持0.6.x以上是目前正在開發中。這意味着,bogart必須坐等它,直到不同版本的Node.js在Nodester上運行。

對諾德斯特的開發者大力支持他們的快速,廣泛和迷人的支持。

相關問題