OpenAgricultureFoundation / openag_ui

UI for OpenAg food computers
GNU General Public License v3.0
53 stars 27 forks source link

Error deploying to couchdb via `npm run couchapp_deploy` #148

Open davoclavo opened 7 years ago

davoclavo commented 7 years ago

I'm unable to deploy the UI to couchdb via npm run couchapp_deploy --app_db_url="http://localhost:5984/app". I've tested running it from the raspberry pi and from my laptop (osx) without luck. This is the error I'm getting

root@-0ff3b40:/apps/openag_ui# npm run couchapp_deploy --app_db_url="http://localhost:5984/app"

> openag-ui@0.0.2 couchapp_deploy /apps/openag_ui
> ./node_modules/grunt-cli/bin/grunt couchapp_deploy

Running "browserify:dist" (browserify) task
>> Bundle ./dist/scripts/main.js created.

Running "copy:main" (copy) task
Created 3 directories, copied 9 files

Running "rmcouchdb:openag_ui" (rmcouchdb) task
Warning: error happened in your connection Use --force to continue.

Aborted due to warnings.

npm ERR! Linux 4.1.21
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "couchapp_deploy"
npm ERR! node v6.11.0
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! openag-ui@0.0.2 couchapp_deploy: `./node_modules/grunt-cli/bin/grunt couchapp_deploy`
npm ERR! Exit status 6
npm ERR!
npm ERR! Failed at the openag-ui@0.0.2 couchapp_deploy script './node_modules/grunt-cli/bin/grunt couchapp_deploy'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the openag-ui package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ./node_modules/grunt-cli/bin/grunt couchapp_deploy
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs openag-ui
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls openag-ui
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /apps/openag_ui/npm-debug.log

root@-0ff3b40:/apps/openag_ui# node --version
v6.11.0
root@-0ff3b40:/apps/openag_ui# git show
commit d4c1f5420427edda46a711f4fdf4afc1a62fcc69
Merge: f51050c 37ab127
Author: Rob Baynes <rbaynes@users.noreply.github.com>
Date:   Wed Jun 21 08:57:29 2017 -0400

    Merge pull request #146 from OpenAgInitiative/all_var_csv

    Add CSV export for all variables
davoclavo commented 7 years ago

Quick temporary workaround: I was able to run the interface via npm run build in the raspberry pi and then running a simple server: cd dist; python -m SimpleHTTPServer, then visiting http://rasp.berry.pi.ip:8000/

sp4ghet commented 7 years ago

I think the problem is it doesn't map the --app_db_url argument properly... I can look into this, but in the meanwhile it's possible to just do ./node_modules/grunt-cli/bin/grunt couchapp_deploy --app_db_url="http://localhost:5984/app"

davoclavo commented 7 years ago

Oh good call! After digging a bit, it seems that a -- has to be included in between the npm command and the arguments. So it becomes:

npm run couchapp_deploy -- --app_db_url="http://localhost:5984/app"