Open iainsproat opened 12 years ago
I am recieving the same error:
Keith$ node app.js
module.js:340
throw err;
^
Error: Cannot find module 'couchapp'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at Object.
npm ERR! System Darwin 10.8.0 npm ERR! command "node" "/usr/local/bin/npm" "install" npm ERR! cwd /Users/Keith/Sites/capptest npm ERR! node -v v0.8.8 npm ERR! npm -v 1.1.59 npm ERR! path /Users/Keith/Sites/capptest/package.json npm ERR! code ENOENT npm ERR! errno 34 npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /Users/Keith/Sites/capptest/npm-debug.log npm ERR! not ok code 0
Additionally, I receive this error when trying to use boilerplate:
Keith$ couchapp boiler capptest Could not create /Users/Keith/Sites/capptest
Despite saying it could not create it, it does, and all boilerplate files are there but do not run.
Some facts: I recently installed CouchDB from Apache and ran it and started using it, and I'm pretty sure it's still running on my MacOSX Snow Leopard system right now (I'm able to curl to it from the command line and access it at 127.0.0.1). I then installed node.couchapp.js using npm with -g and received some errors - same ones I'm getting now - so some research told me I should do it your way by cloning your repo - getting same errors.
Any ideas about what's causing all this ruckus?
My Solution
Firstly, I'd like to say that the #1 problem is that configuring DBs and servers is not my forte, and that's the first step of the problem.
Anyhow, if you type in Terminal or Windows equivalent
npm ls -g
See if you have a dependancy issue with the mime module. I did have this issue (https://github.com/mikeal/node.couchapp.js/issues/60) and I followed the path in bin/ and changed "mime" : "1.2.2" to "mime" : "*". I also performed and npm update and restarted my computer. After doing so, I was able to work with node.couchapp.js by doing the following:
DONT use the node command to run app.js. You are not using node server in this case, you are only using node on the client side. What you should do is start CouchDB, and then do the following:
couchapp push http://127.0.0.1:5984/NameOfYourDatabase app.js
What this is doing is actually loading the application as JSON into CouchDB, and creating a bunch of JSON information that will let you serve your app up by going to localhost:5984/NameOfYourDatabase
NOTE: NameOfYourDatabase has to exist already. You can create a database with curl.
Hope that helps!
make sure you are in the file directory.
I received a
Cannot find module
error when trying to use couchapp on Windows XP. I'm not sure whether this is an npm issue or whether it is node couchapp. I'm running node version 0.6.13 and npm version 1.1.9.installed couchapp globally:
and installed couchapp locally:
Then I created the most basic
app.js
file:And tried running
but unfortunately it failed to work for me. I received the following error:
Instead I managed to get it working with the following: