TypeError: JSON5.parse is not a function

803 Views Asked by At

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!

0

There are 0 best solutions below