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

I keep getting an 'UnhandledPromiseRejectionWarning' when trying to run pagecrypt using npm.. #24

Closed
pm-Architect opened this issue Jul 23, 2021 · 4 comments

Comments

@pm-Architect
Copy link

pm-Architect commented Jul 23, 2021

pagecrypt index.html encrypted.html password

πŸ” Encrypting index.html β†’ encrypted.html with πŸ”‘: password
(node:1608) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'getRandomValues' of undefined
    at getEncryptedPayload (...*/node_modules/pagecrypt/cli.js:61:31)
    at encryptHTML (...*/node_modules/pagecrypt/cli.js:74:100)
    at encryptFile (...*/node_modules/pagecrypt/cli.js:98:16)
    at async encrypt (...*/node_modules/pagecrypt/cli.js:107:21)
    at async ...*/node_modules/pagecrypt/cli.js:129:5
(Use `node --trace-warnings ...` to show where the warning was created)
(node:1608) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)     
(node:1608) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Am I missing something?

@Greenheart
Copy link
Owner

Hi! Are you using Node.js v15 or newer?

I recommend using Node.js v16, which will be the next LTS release in October 2021.

node -v

Let me know if this helps! πŸ™‚

@Greenheart
Copy link
Owner

I added the recommended Node.js versions to package.json a while back, but that's not clear enough.

I'm adding a note to the README file to make sure more people see it :)

@Greenheart
Copy link
Owner

@pm-Architect I'll assume upgrading Node.js solved your issue - let me know if you find anything else.

Have a nice day! :)

@pm-Architect
Copy link
Author

Yes it did. 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

2 participants