Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find name 'Node', 'Attr', 'XPathNSResolver', 'XPathResult'... #86

Closed
khusamov opened this issue Jun 22, 2018 · 3 comments
Closed

Comments

@khusamov
Copy link

node_modules/xpath/xpath.d.ts(1,22): error TS2304: Cannot find name 'Node'.
node_modules/xpath/xpath.d.ts(1,29): error TS2304: Cannot find name 'Attr'.
node_modules/xpath/xpath.d.ts(3,33): error TS2304: Cannot find name 'Node'.
node_modules/xpath/xpath.d.ts(4,32): error TS2304: Cannot find name 'Node'.
node_modules/xpath/xpath.d.ts(7,52): error TS2304: Cannot find name 'Node'.
node_modules/xpath/xpath.d.ts(8,59): error TS2304: Cannot find name 'Node'.
node_modules/xpath/xpath.d.ts(8,75): error TS2304: Cannot find name 'XPathNSResolver'.
node_modules/xpath/xpath.d.ts(8,114): error TS2304: Cannot find name 'XPathResult'.
node_modules/xpath/xpath.d.ts(8,128): error TS2304: Cannot find name 'XPathResult'.
@Sabyasachi2k
Copy link

do not do the import in typescript

this should work.
// tslint:disable-next-line:no-var-requires
const xmldom = require("xmldom");
// tslint:disable-next-line:no-var-requires
const xpath = require("xpath");

@deskoh
Copy link

deskoh commented Sep 2, 2019

Can add dom library to tsconfig,json:

{
  "compilerOptions": {
    "lib": [
      "dom",
      //...
    ],
  }
}

@khusamov
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants