2012-06-14 29 views
0

我試圖在Windows上推一個簡單的couchapp,但我正在努力工作。錯誤。無法使用node.couchapp.js推送couchapp

首先我安裝couchapp使用NPM:

D:\test>npm -g install couchapp 
D:\test>npm install couchapp 

我知道,有兩種不同勢couchapps,但我shurely使用節點couchapp:

D:\test>couchapp 
The "sys" module is now called "util". It should have a similar interface. 
couchapp -- utility for creating couchapps 

Usage: 
    couchapp <command> app.js http://localhost:5984/dbname 

Commands: 
    push : Push app once to server. 
    sync : Push app then watch local files for changes. 
    boiler : Create a boiler project. 

現在我創建couchapp:

couchapp鍋爐

這產生了app.js和一個附件包含一個簡單的couchapp的文件夾。現在我想將它推到CouchDB的:

couchapp push app.js http://localhost:5984/test 

這導致以下錯誤:

node.js:201 
     throw e; // process.nextTick error, or 'error' event on first tick 
      ^
Error: Cannot find module 'app.js' 
    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> (D:\test\node_modules\couchapp\bin.js:78:24) 
    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) 

什麼我dooing錯了嗎?請幫助我

回答

1

我不知道這個答案,但我可以幫你調試問題。如果你去這個line和console.log path.join(process.cwd(), path.normalize(pathname))的結果,那麼你可以找出couchapp試圖抓住你的app.js文件。

此外,如果可能,你應該看看kanso.js。上次我創建了一個couchapp(六個月前),kanso.js比node.couchapp.js好很多。

+0

謝謝你的提示。我放棄了它:問題是npm regestry的軟件包已過時(請參閱https://github.com/mikeal/node.couchapp.js/pull/41)。我現在使用的是github的版本。 – Ingemar

+0

kanso接縫是一個很好的選擇...我將不得不潛入 – Ingemar