Chris Klingler
Chris Klingler

Reputation: 5296

Enable CORS for PouchDB to work with CouchDB

Following this tutorial: http://pouchdb.com/guides/setup-couchdb.html and I was able to install CouchDB and get it set up, then I installed Node.js to be able to use npm to try to set up CORS, but when I did I got the following error: 'Error: EACCES, mkdir '/usr/local/lib/node_modules/add-cors-to-couchdb' ... Please try running this command again as root/Administrator ...not ok code 0'

Any help?

Upvotes: 1

Views: 460

Answers (1)

Chris Klingler
Chris Klingler

Reputation: 5296

I quickly found that this is an authentication error and that I must sign in as an admin to set up CORS, so I used

 sudo chown -R $USER /usr/local

and put in my password for the computer to become an admin in terminal and then I could easily install with

$ npm install -g add-cors-to-couchdb

and run it with

 $ add-cors-to-couchdb

and got 'Success'

Upvotes: 4

Related Questions