vishal singh
vishal singh

Reputation: 1

Error: You are not a server admin couch db using nano module in node js

I am getting this error when I am using couch database using nano module

I am trying to create a new database using express in node js.

{ Error: You are not a server admin.
  
  name: 'Error',
  error: 'unauthorized',
  reason: 'You are not a server admin.',
  scope: 'couch',
  statusCode: 401,
  request:
   { method: 'PUT',
     headers:
      { 'content-type': 'application/json',
        accept: 'application/json' },
     uri: 'http://localhost:5984/address',
     qsStringifyOptions: { arrayFormat: 'repeat' } },
  headers:
   { uri: 'http://localhost:5984/address',
     statusCode: 401,
     'cache-control': 'must-revalidate',
     connection: 'close',
     'content-type': 'application/json',
     date: 'Fri, 18 Sep 2020 16:37:08 GMT',
     'x-couch-request-id': 'e97c956ace',
     'x-couchdb-body-time': '0' },
  errid: 'non_200',
  description: 'couch returned 401' }

Upvotes: 0

Views: 1133

Answers (1)

Aziz Ganiyu
Aziz Ganiyu

Reputation: 31

Pass your username and password to the url

var nano = require('nano')('http://admin:[email protected]:5984');

Upvotes: 3

Related Questions