【问题标题】:Unable to push couchapp with node.couchapp.js无法使用 node.couchapp.js 推送 couchapp
【发布时间】:2012-06-14 17:18:36
【问题描述】:

我正在尝试在 Windows 上推送一个简单的 couchapp,但我正在做某事。错了。

首先我使用 npm 安装 couchapp:

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

我知道有两个不同的 couchapp,但我肯定使用节点 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 锅炉

这将创建一个 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)

我做错了什么?请帮帮我

【问题讨论】:

    标签: node.js couchapp


    【解决方案1】:

    我不知道这个问题的答案,但我也许可以帮助您调试问题。如果你去这个line 和console.log path.join(process.cwd(), path.normalize(pathname)) 的结果,那么你可以找出couchapp 试图获取你的app.js 文件的位置。

    如果可能,您还应该查看 kanso.js。上次我创建了一个 couchapp(六个月前)kanso.js 比 node.couchapp.js 好很多。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-09-21
    • 1970-01-01
    • 2021-11-25
    • 2018-01-18
    • 2014-08-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多