Currently experiencing something that is absolutely baffling. I am requiring the 'qrcode' module which I installed via npm (npm --save install qrcode).
const {
QRCode
} = require('qrcode');
The module is listed in my package.json and does exist in node_modules. However, this is absolutely always 'undefined'. When hovering over the string in the require statement I see that it is some how referencing a node_modules directory in my local/AppData directory which I'm assuming is the global directory for modules. Using this path always results in 'undefined'. I then tried switching the path to reference the local node_modules qrcode and still 'undefined'. I've read everything here https://www.npmjs.com/package/qrcode but doesn't help with the issue I'm seeing and there appears to be not a single conversation on google about this.
TypeError: Cannot read property 'toDataURL' of undefined
When using the 'qrcode' string it is using something in the @types folder which I thought was for ES6 which I am not using. No idea how to proceed nothing adds up here, any help greatly appreciated!
Node.js example from npm package page(if only it were this easy)
var QRCode = require('qrcode')
QRCode.toDataURL('I am a pony!', function (err, url) {
console.log(url)
})