Skip to content

Conversation

leomeneguzzi
Copy link

@leomeneguzzi leomeneguzzi commented Oct 17, 2025

Context

The libraries json2xml and xml2json are not maintained, and the xml2json doesn't work with newer Node.js versions.

expat/build/Release/node_expat.node: invalid ELF header
    at Module._extensions..node (node:internal/modules/cjs/loader:1454:18)
    at Module.load (node:internal/modules/cjs/loader:1208:32)
    at Module._load (node:internal/modules/cjs/loader:1024:12)
    at Module.require (node:internal/modules/cjs/loader:1233:19)
    at Module.patchedRequire (.../node_modules/.pnpm/[email protected]/node_modules/require-in-the-middle/index.js:256:27)
    at Hook._require.Module.require (.../node_modules/.pnpm/[email protected]/node_modules/require-in-the-middle/index.js:181:27)
    at require (node:internal/modules/helpers:179:18)
    at bindings (.../node_modules/.pnpm/[email protected]/node_modules/bindings/bindings.js:112:48)
    at Object.<anonymous> (.../node_modules/.pnpm/[email protected]/node_modules/node-expat/lib/node-expat.js:4:34)
    at Module._compile (node:internal/modules/cjs/loader:1358:14) {
  code: 'ERR_DLOPEN_FAILED'
}

Node.js v20.15.1

Changes

  • I just changed the utils functions, where it imports and uses the removed dependencies, to use the fast-xml-parser.
  • I also set the fast-xml-parser options to generate the same output for both cases.
  • Also, I removed from the package.json the json2xml and xml2json, and added the fast-xml-parser

The libraries json2xml and xml2json are not maintained and don't work with newer Node.js versions
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

Successfully merging this pull request may close these issues.

1 participant