jasonlong/mater

Electron gives error when trying to import node:os module

Closed this issue · 2 comments

I tried running npm start but it gave this error:

> mater@1.0.9 start
> electron main.js

App threw an error during load
Error: Cannot find module 'node:os'
Require stack:
- /Users/sidma/Developer/mater/main.js
- /Users/sidma/Developer/mater/node_modules/electron/dist/Electron.app/Contents/Resources/default_app.asar/main.js
- 
    at Module._resolveFilename (internal/modules/cjs/loader.js:972:15)
    at Function.n._resolveFilename (electron/js2c/browser_init.js:249:921)
    at Module._load (internal/modules/cjs/loader.js:848:27)
    at Function.f._load (electron/js2c/asar_bundle.js:5:12633)
    at Module.require (internal/modules/cjs/loader.js:1032:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/Users/sidma/Developer/mater/main.js:2:18)
    at Module._compile (internal/modules/cjs/loader.js:1152:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1173:10)
    at Module.load (internal/modules/cjs/loader.js:992:32)

Maybe older versions of Electron are not compatible with newer Node.js modules?

Thanks for the heads-up, @sidma64. I'll recheck things here.

This should be fixed up w/ #264.