'TypeError: JSON5.parse is not a function

I have installed JSON5 by npm install -d -g json5 and trying to parse the json string. But it is showing me [[object Object]]JSON5.parse is not a function. What the problem actually here is? and how we can resolve this? I am using the following code-

const JSON5 = require("json5")
var jsonV = JSON5.parse(fileStr)

Thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source