LJH LJH - 1 year ago 197
Node.js Question

Error with any Dropbox API calls (node.js) — "Error: getaddrinfo EAI_AGAIN api.dropboxapi.com:443"

I am attempting to set up Dropbox on my server side using Node.js. I have used the official documentation to write the very basic code to do this, with an access token generated from dropbox.com (just until I get this working). The code I used is shown below and is a variant on the code at http://dropbox.github.io/dropbox-sdk-js/index.html .

'use strict';
var express = require('express');
var router = express.Router();
var Dropbox = require('dropbox');
router.post('/testDropbox', function(req, res) {
var dbx = new Dropbox({ accessToken: req.body.dbxAccessToken});
dbx.filesListFolder({ path: ''})
.then(function (response) {
.catch(function (err) {

This caught error reads "Error: getaddrinfo EAI_AGAIN api.dropboxapi.com:443".

I am releatively new to Node.js so I hope it something simple I have missed perhaps in the set up.
Also, I am behind a proxy that uses NTLM and seeing an error with "443" in it does ring some alarm bells in my head.

Answer Source

Your proxy may be blocking calls

If you can bypass the proxy, try this to see if the proxy is causing the issue. Unfortunately, many corporations don't allow one to bypass a proxy so you may need to speak to someone in charge of such things to try and help.

The workaround I use

I now use a WiFi dongle connected to an external router to bypass the proxy. My code, as shown in the question, works as expected and with no errors.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download