在 electron.js npm start 命令中不是 working.its 说电子不被识别为内部或外部命令

in electron.js npm start command not working.its saying electron is not recognise as internal or external command

operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron@1.0.0 start: `electron .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the electron@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

好像还没有安装electron。为了 运行 electron 命令,您需要正确安装和配置 node 和 npm,然后 运行。

npm i -g electron

我几乎尝试了所有方法,但最终我能够解决它。

"electron-webpack-quick-start" 为我们设置一切我们不需要担心安装 pacakges 只是 运行 命令并玩得开心 它对我有用。

  1. mkdir new-electron-webpack-project
  2. cd new-electron-webpack-project

    3.curl -fsSL https://github.com/electron-userland/electron-webpack-quick-start/archive/master.tar.gz | tar -xz --strip-components 1

  3. git 克隆 https://github.com/electron-userland/electron-webpack-quick-start.git

5.cd electron-webpack-quick-start

  1. rm -rf .git

8.yarn开发

有关详细信息,请阅读下面的 link https://github.com/electron-userland/electron-webpack-quick-start