Greenheart / pagecrypt

Password Protected Single Page Applications and HTML files
GNU Affero General Public License v3.0
233 stars 25 forks source link

Get an Error-Message #30

Closed gavberlin closed 2 years ago

gavberlin commented 2 years ago

npx pagecrypt index.html index_encrypt.html test file:///home/ansible/node_modules/pagecrypt/cli.js:23 var crypto = await loadCrypto(); ^^^^^

SyntaxError: Unexpected reserved word at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18) at async link (internal/modules/esm/module_job.js:42:21) npm ERR! code 1 npm ERR! path /home/ansible/pagecrypt npm ERR! command failed npm ERR! command sh -c pagecrypt "index.html" "index_encrypt.html" "test"

npm ERR! A complete log of this run can be found in: npm ERR! /home/ansible/.npm/_logs/2021-12-23T12_13_17_224Z-debug.log

Greenheart commented 2 years ago

Hey! This seems to be caused by an old Node.js version that doesn't support top-level await or ESM module imports.

Pagecrypt works best with Node.js v16 or newer. What version do you get from running node -v in your terminal? If it's <= 15 please try upgrading to v16 and it should hopefully solve the issue :)

https://nodejs.org/en/

gavberlin commented 2 years ago

Hey! Yepp, that was the solution...debian bullseye brings only node-12.2 in the repository. Now it works Tag!

Greenheart commented 2 years ago

Great! Good luck with your project and feel free to share any feedback!