I've tried to install Electron with npm on my computer these days, and it's installation is successful, but when I tried to run Electron, I get an error.
Here are my commands in the Windows Terminal:
PS [user profile location]> npm install -g electron
added 91 packages in 7s
PS [user profile location]> electron
node:internal/modules/cjs/loader:959
throw err;
^
Error: Cannot find module '[node js location]\node_modules\electron\cli.js'
at Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
at Module._load (node:internal/modules/cjs/loader:804:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Node.js v18.7.0