lonekorean / wordpress-export-to-markdown

Converts a WordPress export XML file into Markdown files.
MIT License
1.16k stars 228 forks source link

[SOLVED]SyntaxError: Unexpected token '.' at if (globalThis.Symbol?.iterator) { #132

Closed KSroido closed 2 hours ago

KSroido commented 3 hours ago

I export xml to folder and did this:

root@VM-16-10-debian:~/mybackup_wp# npm config set registry https://registry.npmmirror.com
root@VM-16-10-debian:~/mybackup_wp# npx wordpress-export-to-markdown
Need to install the following packages:
  wordpress-export-to-markdown
Ok to proceed? (y) 
/root/.npm/_npx/a8913a54bce5e168/node_modules/@mixmark-io/domino/lib/Element.js:1104
if (globalThis.Symbol?.iterator) {
                      ^

SyntaxError: Unexpected token '.'
    at wrapSafe (internal/modules/cjs/loader.js:915:16)
    at Module._compile (internal/modules/cjs/loader.js:963:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/root/.npm/_npx/a8913a54bce5e168/node_modules/@mixmark-io/domino/lib/Document.js:7:15)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
npm ERR! code 1
npm ERR! path /root/mybackup_wp
npm ERR! command failed
npm ERR! command sh -c wordpress-export-to-markdown

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2024-11-18T07_32_55_947Z-debug.log
root@VM-16-10-debian:~/mybackup_wp# ls 
blog.wordpress.2024-11-18.000.xml
KSroido commented 3 hours ago

if any further info is needed, I would like to attach

KSroido commented 2 hours ago

btw my node version is not a latest LTS version

root@VM-16-10-debian:~/mybackup_wp# node -v
v12.22.12
KSroido commented 2 hours ago

solved by updating to 22 verison curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash

nvm install 22