I am getting this error, i have installed xmldom using
npm install xmldom
, into the directory
C:\Program Files (x86)\nodejs_10.35\node_modules\npm\node_modules
.
i checked the package.json inside xmldom, it is intact and when i run my script with this line
var DOMParser = require('xmldom').DOMParser;
I get the error.
I searched a lot to resolve this issue, I verified all the suggestions but none worked. In some thread someone suggested to install wherever app.js file is present, but I could not find that in my nodejs installation directory.
you need to npm install xmldom
in the directory (or in a parent directory) of the directory where your script resides that does the require(xmldom)
and not where node is installed
As per latest changes made in library npm install xmldom
is no longer supported. We should use npm i @xmldom/xmldom
Since version 0.7.0 this package is published to npm as @xmldom/xmldom and no longer as xmldom, because we are no longer able to publish xmldom.
NPM documentation available here for more details
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With