You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Jason Woodruff <ja...@btinternet.com> on 2011/12/08 16:16:21 UTC

couchapp on node.js

Hi

I'm experiencing some strange behaviour with couchapp on node.js.

For example,  I receive a 'could not create' message, even though the app
is created?

$ couchapp boiler test3
Could not create /home/jason/CouchApps/test3
........................???????

And, so as to prove it, I can then push it to the db

$ couchapp push app.js http://127.0.0.1:5984/test3
Preparing.
Serializing.
PUT http://127.0.0.1:5984/test3/_design/app
Finished push. 1-72b18a3b961a0f16fa9f988cb9c28da2

I've cloned Chris Anderson's 'sofa' blog app.

git clone git://github.com/jchris/sofa.git

But despite every which way I can think of I cannot get it to push to the
db.

I'm using

couchapp push app.js http://127.0.0.1:5984/[new empty db]

I've called this from the sofa, _attachment and script directories.
Nothing works.  Running from the /script directory this is the error:

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
ReferenceError: $ is not defined
    at Object.<anonymous>
(/home/jason/CouchApps/sofa/_attachments/script/app.js:1:63)
    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 Module.require (module.js:357:17)
    at require (module.js:368:17)
    at Object.<anonymous>
(/usr/local/lib/node_modules/couchapp/bin.js:78:24)
    at Module._compile (module.js:432:26)
    at Object..js (module.js:450:10)

Pulling sofa into /usr/local and going through the same process of running
the command from the /script directory I get a different error.

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:334:11)
    at Function._load (module.js:279:25)
    at Module.require (module.js:357:17)
    at require (module.js:368:17)
    at Object.<anonymous>
(/usr/local/lib/node_modules/couchapp/bin.js:78:24)
    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)


Is this all a bit buggy, or am I making a horlicks of things?

Thanks

Jason

Re: couchapp on node.js

Posted by Jason Woodruff <ja...@btinternet.com>.
Ryan
Yes, I'd just found that very same entry when your email arrived.
This is exactly it.
Thank-you for the reply.  Unfortunately, it would seem that the definitive
guide isn't quite so definitive as it could be!
Thanks
Jason

On 8 December 2011 15:49, Ryan Ramage <ry...@gmail.com> wrote:

> There are a few different 'couchapp' tools kicking around. Some have
> different project structures.  See here:
>
> http://couchapp.org/page/index
>
> Sounds like you are trying to use the node.couchapp.js on a CouchApp
> command line tool (python) project.
>
> From the wiki:
> "Note that you cannot use Python couchapp to push couchapps written
> using node.couchapp.js into Couch and vice versa."
>
>
>
>
>
>
>
>
> On Thu, Dec 8, 2011 at 8:41 AM, Jason Woodruff
> <ja...@btinternet.com> wrote:
> > Beginning to answer my own question.
> >
> > The app.js file in the sofa app doesn't have the same structure as those
> > created by couchapp boiler.
> >
> > Is the sofa app out-of-date to be learning couchdb with?  In which case
> > should I be bothering with the definitive guide?
> >
> > Jason
> >
> > On 8 December 2011 15:16, Jason Woodruff <jasonwoodruff@btinternet.com
> >wrote:
> >
> >> Hi
> >>
> >> I'm experiencing some strange behaviour with couchapp on node.js.
> >>
> >> For example,  I receive a 'could not create' message, even though the
> app
> >> is created?
> >>
> >> $ couchapp boiler test3
> >> Could not create /home/jason/CouchApps/test3
> >> ........................???????
> >>
> >> And, so as to prove it, I can then push it to the db
> >>
> >> $ couchapp push app.js http://127.0.0.1:5984/test3
> >> Preparing.
> >> Serializing.
> >> PUT http://127.0.0.1:5984/test3/_design/app
> >> Finished push. 1-72b18a3b961a0f16fa9f988cb9c28da2
> >>
> >> I've cloned Chris Anderson's 'sofa' blog app.
> >>
> >> git clone git://github.com/jchris/sofa.git
> >>
> >> But despite every which way I can think of I cannot get it to push to
> the
> >> db.
> >>
> >> I'm using
> >>
> >> couchapp push app.js http://127.0.0.1:5984/[new empty db]
> >>
> >> I've called this from the sofa, _attachment and script directories.
> >> Nothing works.  Running from the /script directory this is the error:
> >>
> >> node.js:201
> >>         throw e; // process.nextTick error, or 'error' event on first
> tick
> >>               ^
> >> ReferenceError: $ is not defined
> >>     at Object.<anonymous>
> >> (/home/jason/CouchApps/sofa/_attachments/script/app.js:1:63)
> >>     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 Module.require (module.js:357:17)
> >>     at require (module.js:368:17)
> >>     at Object.<anonymous>
> >> (/usr/local/lib/node_modules/couchapp/bin.js:78:24)
> >>     at Module._compile (module.js:432:26)
> >>     at Object..js (module.js:450:10)
> >>
> >> Pulling sofa into /usr/local and going through the same process of
> running
> >> the command from the /script directory I get a different error.
> >>
> >> 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:334:11)
> >>     at Function._load (module.js:279:25)
> >>     at Module.require (module.js:357:17)
> >>     at require (module.js:368:17)
> >>     at Object.<anonymous>
> >> (/usr/local/lib/node_modules/couchapp/bin.js:78:24)
> >>     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)
> >>
> >>
> >> Is this all a bit buggy, or am I making a horlicks of things?
> >>
> >> Thanks
> >>
> >> Jason
> >>
> >>
> >>
> >>
> >>
>
>
>
> --
> Twitter: @eckoit
> http://eckoit.com - Keep what you hear.
> http://opendoorstories.com  - Create Experiences
>

Re: couchapp on node.js

Posted by Ryan Ramage <ry...@gmail.com>.
There are a few different 'couchapp' tools kicking around. Some have
different project structures.  See here:

http://couchapp.org/page/index

Sounds like you are trying to use the node.couchapp.js on a CouchApp
command line tool (python) project.

>From the wiki:
"Note that you cannot use Python couchapp to push couchapps written
using node.couchapp.js into Couch and vice versa."








On Thu, Dec 8, 2011 at 8:41 AM, Jason Woodruff
<ja...@btinternet.com> wrote:
> Beginning to answer my own question.
>
> The app.js file in the sofa app doesn't have the same structure as those
> created by couchapp boiler.
>
> Is the sofa app out-of-date to be learning couchdb with?  In which case
> should I be bothering with the definitive guide?
>
> Jason
>
> On 8 December 2011 15:16, Jason Woodruff <ja...@btinternet.com>wrote:
>
>> Hi
>>
>> I'm experiencing some strange behaviour with couchapp on node.js.
>>
>> For example,  I receive a 'could not create' message, even though the app
>> is created?
>>
>> $ couchapp boiler test3
>> Could not create /home/jason/CouchApps/test3
>> ........................???????
>>
>> And, so as to prove it, I can then push it to the db
>>
>> $ couchapp push app.js http://127.0.0.1:5984/test3
>> Preparing.
>> Serializing.
>> PUT http://127.0.0.1:5984/test3/_design/app
>> Finished push. 1-72b18a3b961a0f16fa9f988cb9c28da2
>>
>> I've cloned Chris Anderson's 'sofa' blog app.
>>
>> git clone git://github.com/jchris/sofa.git
>>
>> But despite every which way I can think of I cannot get it to push to the
>> db.
>>
>> I'm using
>>
>> couchapp push app.js http://127.0.0.1:5984/[new empty db]
>>
>> I've called this from the sofa, _attachment and script directories.
>> Nothing works.  Running from the /script directory this is the error:
>>
>> node.js:201
>>         throw e; // process.nextTick error, or 'error' event on first tick
>>               ^
>> ReferenceError: $ is not defined
>>     at Object.<anonymous>
>> (/home/jason/CouchApps/sofa/_attachments/script/app.js:1:63)
>>     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 Module.require (module.js:357:17)
>>     at require (module.js:368:17)
>>     at Object.<anonymous>
>> (/usr/local/lib/node_modules/couchapp/bin.js:78:24)
>>     at Module._compile (module.js:432:26)
>>     at Object..js (module.js:450:10)
>>
>> Pulling sofa into /usr/local and going through the same process of running
>> the command from the /script directory I get a different error.
>>
>> 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:334:11)
>>     at Function._load (module.js:279:25)
>>     at Module.require (module.js:357:17)
>>     at require (module.js:368:17)
>>     at Object.<anonymous>
>> (/usr/local/lib/node_modules/couchapp/bin.js:78:24)
>>     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)
>>
>>
>> Is this all a bit buggy, or am I making a horlicks of things?
>>
>> Thanks
>>
>> Jason
>>
>>
>>
>>
>>



-- 
Twitter: @eckoit
http://eckoit.com - Keep what you hear.
http://opendoorstories.com  - Create Experiences

Re: couchapp on node.js

Posted by Jason Woodruff <ja...@btinternet.com>.
Beginning to answer my own question.

The app.js file in the sofa app doesn't have the same structure as those
created by couchapp boiler.

Is the sofa app out-of-date to be learning couchdb with?  In which case
should I be bothering with the definitive guide?

Jason

On 8 December 2011 15:16, Jason Woodruff <ja...@btinternet.com>wrote:

> Hi
>
> I'm experiencing some strange behaviour with couchapp on node.js.
>
> For example,  I receive a 'could not create' message, even though the app
> is created?
>
> $ couchapp boiler test3
> Could not create /home/jason/CouchApps/test3
> ........................???????
>
> And, so as to prove it, I can then push it to the db
>
> $ couchapp push app.js http://127.0.0.1:5984/test3
> Preparing.
> Serializing.
> PUT http://127.0.0.1:5984/test3/_design/app
> Finished push. 1-72b18a3b961a0f16fa9f988cb9c28da2
>
> I've cloned Chris Anderson's 'sofa' blog app.
>
> git clone git://github.com/jchris/sofa.git
>
> But despite every which way I can think of I cannot get it to push to the
> db.
>
> I'm using
>
> couchapp push app.js http://127.0.0.1:5984/[new empty db]
>
> I've called this from the sofa, _attachment and script directories.
> Nothing works.  Running from the /script directory this is the error:
>
> node.js:201
>         throw e; // process.nextTick error, or 'error' event on first tick
>               ^
> ReferenceError: $ is not defined
>     at Object.<anonymous>
> (/home/jason/CouchApps/sofa/_attachments/script/app.js:1:63)
>     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 Module.require (module.js:357:17)
>     at require (module.js:368:17)
>     at Object.<anonymous>
> (/usr/local/lib/node_modules/couchapp/bin.js:78:24)
>     at Module._compile (module.js:432:26)
>     at Object..js (module.js:450:10)
>
> Pulling sofa into /usr/local and going through the same process of running
> the command from the /script directory I get a different error.
>
> 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:334:11)
>     at Function._load (module.js:279:25)
>     at Module.require (module.js:357:17)
>     at require (module.js:368:17)
>     at Object.<anonymous>
> (/usr/local/lib/node_modules/couchapp/bin.js:78:24)
>     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)
>
>
> Is this all a bit buggy, or am I making a horlicks of things?
>
> Thanks
>
> Jason
>
>
>
>
>