❯ electron-forge
✔ Checking your system
Usage: electron-forge [options] [command]
Commands:
init Initialize a new Electron application
import Attempts to navigate you through the process of importing an existing project to "electron-forge"
lint Lints the current Electron application
package Package the current Electron application
make Generate distributables for the current Electron application
start Start the current Electron application
publish Publish the current Electron application to GitHub
install Install an Electron application from GitHub
help [cmd] display help for [cmd]
Options:
-h, --help output usage information
-V, --version output the version number
--verbose Enables verbose mode
I tried init without commands:
~/zeke master*
❯ electron-forge init
✔ Checking your system
electron-forge-init(1) does not exist, try --help
I tried init with --help:
~/zeke master*
❯ electron-forge init --help
✔ Checking your system
electron-forge-init(1) does not exist, try --help
I tried help init
~/zeke master*
❯ electron-forge help init
✔ Checking your system
electron-forge-init(1) does not exist, try --help
Suggestions:
When init is invoked incorrectly, show usage / examples.
Allow electron-forge init --help or similar to be used to find out how the command works.
All of those commands you ran should work as you expected. What version of forge are you running?
❯ electron-forge -V
✔ Checking your system
2.7.4
❯ uname -a
Darwin C02R41WSFVH8 16.3.0 Darwin Kernel Version 16.3.0: Thu Nov 17 20:23:58 PST 2016; root:xnu-3789.31.2~1/RELEASE_X86_64 x86_64
@zeke Can you try reinstalling electron-forge
npm uninstall -g electron-forge
npm install -g electron
❯ electron-forge init
electron-forge-init(1) does not exist, try --help
❯ electron-forge init --help
electron-forge-init(1) does not exist, try --help
❯ electron-forge help init
electron-forge-init(1) does not exist, try --help
❯ electron-forge init foo
electron-forge-init(1) does not exist, try --help
❯ electron-forge -V
2.7.4
❯ node -v
v7.2.1
Looks like the version I was using earlier today is still the latest:
❯ npm show electron-forge dist-tags
{ latest: '2.7.4' }
This actually makes no sense to me 😢
What shell are you using?
I even matched your node version to see if that was it but electron-forge init --help and friends always output / perform correctly for me. 😕
echo $0
-zsh
@zeke Can you try this again on the latest version, this is still bugging me in the back of my mind 👍
It's working! 🎈
All the various incantations are fixed:
❯ electron-forge init
✔ Checking your system
? WARNING: The specified path: "/Users/zeke/Desktop" is not empty, do you wish to continue? No
✖ Initializing Project Directory
Electron forge was terminated:
Cancelled by user
❯ electron-forge init --help
✔ Checking your system
Usage: electron-forge-init [options] [name]
Options:
-h, --help output usage information
-V, --version output the version number
-t, --template [name] Name of the forge template to use
-l, --lintstyle [style] Linting standard to follow. For the default template it can be "airbnb" or "standard"
❯ electron-forge init myproject
✔ Checking your system
✔ Initializing Project Directory
✔ Initializing Git Repository
✔ Copying Starter Files
✔ Initializing NPM Module
✔ Installing NPM Dependencies
❯ electron-forge help init
✔ Checking your system
Usage: electron-forge-init [options] [name]
Options:
-h, --help output usage information
-V, --version output the version number
-t, --template [name] Name of the forge template to use
-l, --lintstyle [style] Linting standard to follow. For the default template it can be "airbnb" or "standard"
If this ends up happening to anyone else, I was trying to install electron-forge globally with Yarn and it looks like it has to be done with NPM specifically for some reason.
npm install -g electron-forge
Okay, so I had the same problem with Yarn on Ubuntu. It works with NPM. Has anyone figured out why it doesn't install well with Yarn?
Perhaps it'd be worth to add a note to the README that Yarn shouldn't be used until it's figured out how to fix the problem?
I found out that yarn is somehow still used. When the project was created, even though I used NPM, there was a yarn.lock file in my project's root directory. I do not know how this happened.
@assetcorp The same for me, although I do use Yarn for development now. It generally works, it's only the global package that needs to be installed using npm.
Most helpful comment
If this ends up happening to anyone else, I was trying to install
electron-forgeglobally with Yarn and it looks like it has to be done with NPM specifically for some reason.