question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Node.js 9.0 does not appear to work

See original GitHub issue

#### Summary

Not sure if this is due to Node 9.0 but axios definitely does not work on it.

 {
   "url": "<path>",
   "method": "POST",
   "baseURL": "<url>",
   "timeout": 15000,
   "headers": {
     "Header-Name": "Header-Value"
   },
   "data": {
     "some": "data"
   }
 }

–>

0|developm | 3:17:59:936 am | [SERVER] |  [ERROR] | API REQUEST | Error Caught during Request |  HyxwGat0W session /v2/system/session TypeError [ERR_MISSING_ARGS]: The "value" argument must be specified
0|developm |     at validateHeader (_http_outgoing.js:501:11)
0|developm |     at ClientRequest.setHeader (_http_outgoing.js:510:3)
0|developm |     at new ClientRequest (_http_client.js:173:14)
0|developm |     at Object.request (https.js:241:10)
0|developm |     at RedirectableRequest._performRequest (/Users/bradennapier/Desktop/Dash OS/IDE/projects/dash-datastream/apps/datastream/node_modules/follow-redirects/index.js:73:20)
0|developm |     at new RedirectableRequest (/Users/bradennapier/Desktop/Dash OS/IDE/projects/dash-datastream/apps/datastream/node_modules/follow-redirects/index.js:57:7)
0|developm |     at Object.wrappedProtocol.request (/Users/bradennapier/Desktop/Dash OS/IDE/projects/dash-datastream/apps/datastream/node_modules/follow-redirects/index.js:229:10)
0|developm |     at dispatchHttpRequest (/Users/bradennapier/Desktop/Dash OS/IDE/projects/dash-datastream/apps/datastream/node_modules/axios/lib/adapters/http.js:130:25)
0|developm |     at new Promise (<anonymous>)
0|developm |     at httpAdapter (/Users/bradennapier/Desktop/Dash OS/IDE/projects/dash-datastream/apps/datastream/node_modules/axios/lib/adapters/http.js:18:10)

#### Context

  • axios version: 0.17.0
  • Environment: 9.0 OSX

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
bradennapiercommented, Nov 3, 2017

Ok – cryptic error that didnt actualy say a header was undefined. I had lookeda t the values and they were all there but it was due to another issue occurring elsewhere.

Might be good to wrap this and provide a real error 😛

1reaction
jplewcommented, Mar 9, 2018

I was getting the same The "value" argument must be specified error using Node 9.5.0 and Axios 0.18.0.

My problem was similar to @adibkadir, I wasn’t specifiying some required config parameters, apparently. Which is weird, considering my server was working just fine when deployed locally and to Heroku, but suddenly started bugging out when I migrated to Google Cloud Functions. At any rate, in case anyone finds it useful here is my before after:

Before:

const config = {
  headers: {
    Accept: 'application/json',
    app_id: process.env.OXFORD_ID,
    app_key: process.env.OXFORD_KEY,
  },
}

app.get('/api/oxford/inflect/:word', (req, res) => {
  axios
    .get(`${oxfordInflect}/${req.params.word}`, config)
    .then(response => {
      res.json(response.data)
    })
    .catch(err => {
      handleError(err, res)
    })
})

After:

function getConfigObj(type: string, word: string): ConfigObject {
  console.log(host)
  console.log('word', word)

  return {
    method: 'GET',
    url: host + type + word,
    headers: {
      Accept: 'application/json',
      app_id: process.env.OXFORD_ID,
      app_key: process.env.OXFORD_KEY,
    },
  }
}

app.get('/api/oxford/inflection/:word', (req, res) => {

  const type = '/inflections/en/'

  axios(getConfigObj(type, req.params.word))
    .then(response => res.json(response.data))
    .catch(function(error) {
      console.log(error)
    })
})
Read more comments on GitHub >

github_iconTop Results From Across the Web

npm does not support Node.js v9.0.0 - Stack Overflow
I've just upgraded to Node v9 and ran into the same issue. There's a Github issue for this here. Following the advice to...
Read more >
How to resolve 'node' is not recognized as an internal or ...
Open the Environment Variables option in your Control Panel. · Select the variable named Path. · Restart the command prompt again and now...
Read more >
Node v9.9.0 (Current)
Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine.
Read more >
Set up NodeJS on native Windows - Microsoft Learn
js or npm from your operating system before installing a version manager as the different types of installation can lead to strange and ......
Read more >
How To Install Node.js on Ubuntu 22.04 - DigitalOcean
Another way of installing Node.js that is particularly flexible is to use nvm, the Node Version Manager. This piece of software allows you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found