简体   繁体   中英

ElectronJS npm start / bash: electron-forge: command not found

My System:

  • Mac OSX 10.14.6

  • Electron: 10.1.5

  • electron-forge: ^6.0.0-beta.54

I've been working on an Electron side project. I started it using electron-forge, I had a small application functioning just fine, I then set it aside for a couple weeks. Coming back to it, I tried running npm start and it did nothing but return to a new terminal line. So I tried electron-forge start and it returned bash: electron-forge: command not found .

I tried deleting my node_modules folder and reinstalling, I tried creating a new electron-forge boilerplate, and neither made a difference. I tried installing electron-forge globally, but it errored out on the second step, and I found several stackoverflow articles saying I shouldn't have electron-forge installed globally. I haven't changed anything (that I know of) on a system level, but it seems to be a system issue, rather than a package issue, but I'm not knowledgable enough to do anything other than Google the errors and see what stacksoverflow articles are out there, but no articles have helped.

I'd love any and all help, Electron has ceased working on my system completely, and I have no idea how to troubleshoot it. Thanks in advance!

I ended up deleting and re-installing Node and that seems to have fixed it. Still not sure what caused the initial issue, but it's working again. For those interested, here's the resources I used:

Update:

I kept having issues running npm start . What finally worked was to create a new boilerplate project using the CLI and copy the contents of the package-lock.json to the old project. That finally launched the app.

I know this is an old question but, I had the same issue and instead of uninstalling Node, I used rm -rf node_modules then I used npm cache clean --force . I reinstalled my dependencies and electron-forge worked again.

Use the command below

npm install electron

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM