why does the intellisense not work for mathjs?

I installed the mathjs module using the npm.

The instructions are here: https://www.npmjs.com/package/mathjs

I install globally (the -g flag) like this:

npm install -g mathjs

when i write my code in VScode like the below, the intellisense does not work for mathjs. So i cannot see the methods or attributes in the dropdown list when i press ..


/*
why does the intellisense not work for mathjs ?
*/

const mathjs = require('mathjs')  // intellisense does not work
const fs = require('fs')   // intellisense does work


let m = mathjs.mean([1,2,3,4,5])  // the actual module method works fine !
let n = Math.max(1,2,3,4,5)   // the intelisense works fine here too.


console.log(m)
console.log(n)

points to note:

  • the methods do work for mathjs, just not the intellisense.
  • the intellisense work for other imported modules (eg: require('fs')).
  • the intellisense in the Math module also work.

so, it seems to be specifically isolated to this one module.

So the question is: How can i get the intellisense working for mathjs ?