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

Get an Error-Message #30

Closed
gavberlin opened this issue Dec 23, 2021 · 3 comments
Closed

Get an Error-Message #30

gavberlin opened this issue Dec 23, 2021 · 3 comments

Comments

@gavberlin
Copy link

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
Copy link
Owner

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
Copy link
Author

gavberlin commented Dec 23, 2021

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

@Greenheart
Copy link
Owner

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

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

2 participants