-
Notifications
You must be signed in to change notification settings - Fork 53
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
Cannot find module 'node: assert' Require stack #43
Comments
Node v14 not support syntax |
Thank you for your reply. I already tried with Node versions: 16.17.0 and 16.17.1. But received the same error. I wrote only the above code. Do we need to require any other statement? |
whats the version of electron? |
I used the below electron version :
|
The version of nodejs may under v14 some where. const assert = requrire('node:assert')
console.log(assert) or import * as assert from 'node:assert'
console.log(assert) v14 also suppports |
I tried both statements. Still, I am getting this error. Do we need to add this npm package to Electron App? |
I think https://www.npmjs.com/package/assert is unnecessary, it's not nodejs inernal module ( import by prfix |
Sample Repo is available here and I added a Readme.txt file for more details. |
electron v11 bundled with nodejs v12 : https://www.electronjs.org/blog/electron-11-0 |
I found that you need to add this to your BrowserWindow:
Otherwise node libraries wont be available. Note that this is done for security reasons. Tangential note (unrelated to the above issue) electronV21+ wont work due to https://www.electronjs.org/blog/v8-memory-cage |
I installed win32-API version => "win32-api": "^20.1.0".
My Node version is 14.18.5.
The Notepad file is open on my PC.
When trying this code in electron it gives this => "Cannot find module 'node: assert' Require stack" error.
I've tried to find the solution. but haven't found anything yet.
Anyone any idea about this?
The text was updated successfully, but these errors were encountered: