Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

init with a builtin custom template throws a require error #87

Closed
riverar opened this issue Jan 15, 2017 · 3 comments
Closed

init with a builtin custom template throws a require error #87

riverar opened this issue Jan 15, 2017 · 3 comments

Comments

@riverar
Copy link

riverar commented Jan 15, 2017

When using electron-forge to initialize a project on Windows with --template=react, electron-forge fails to recognize the template package isn't installed and bombs out. It's not clear if this is a docbug or softwarebug.

Workaround:
npm install -g electron-forge-template-react before executing electron-forge init

Shortened log (full log available):

  [...]
  electron-forge:runtime-config fetching key verbose +1ms
  electron-forge:runtime-config fetching key verbose +36ms
  electron-forge:init:npm not installing linting deps +39s
  electron-forge:lifecycle Process Succeeded: Installing NPM Dependencies +8ms
  electron-forge:lifecycle Process Started: Locating custom template: "react" +1ms
  electron-forge:init:custom using local template +4ms
  electron-forge:lifecycle Process Succeeded: Locating custom template: "react" +0ms

An unhandled rejection has occurred inside Forge:
path must be a string
AssertionError: path must be a string
    at Module.require (module.js:496:3)
    at require (internal/module.js:20:19)
    at _callee4$ (C:\Users\Rafael\AppData\Roaming\npm\node_modules\electron-forge\dist\init\init-custom.js:108:30)
    at tryCatch (C:\Users\Rafael\AppData\Roaming\npm\node_modules\electron-forge\node_modules\regenerator-runtime\runtime.js:64:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\Rafael\AppData\Roaming\npm\node_modules\electron-forge\node_modules\regenerator-runtime\runtime.js:355:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\Rafael\AppData\Roaming\npm\node_modules\electron-forge\node_modules\regenerator-runtime\runtime.js:116:21)
    at GeneratorFunctionPrototype.tryCatcher (C:\Users\Rafael\AppData\Roaming\npm\node_modules\electron-forge\node_modules\bluebird\js\release\util.js:16:23)
    at PromiseSpawn._promiseFulfilled (C:\Users\Rafael\AppData\Roaming\npm\node_modules\electron-forge\node_modules\bluebird\js\release\generators.js:97:49)
    at Promise._settlePromise (C:\Users\Rafael\AppData\Roaming\npm\node_modules\electron-forge\node_modules\bluebird\js\release\promise.js:572:26)
    at Promise._settlePromise0 (C:\Users\Rafael\AppData\Roaming\npm\node_modules\electron-forge\node_modules\bluebird\js\release\promise.js:612:10)
    at Promise._settlePromises (C:\Users\Rafael\AppData\Roaming\npm\node_modules\electron-forge\node_modules\bluebird\js\release\promise.js:691:18)
    at Async._drainQueue (C:\Users\Rafael\AppData\Roaming\npm\node_modules\electron-forge\node_modules\bluebird\js\release\async.js:133:16)
    at Async._drainQueues (C:\Users\Rafael\AppData\Roaming\npm\node_modules\electron-forge\node_modules\bluebird\js\release\async.js:143:10)
    at Immediate.Async.drainQueues (C:\Users\Rafael\AppData\Roaming\npm\node_modules\electron-forge\node_modules\bluebird\js\release\async.js:17:14)
    at runCallback (timers.js:637:20)
    at tryOnImmediate (timers.js:610:5)
@malept malept changed the title electron-forge --template=react throws due to missing template files init with a builtin custom template throws a require error Jan 15, 2017
@malept
Copy link
Member

malept commented Jan 15, 2017

This happens with all built-in, non-default templates.

@malept
Copy link
Member

malept commented Jan 16, 2017

Fix for this is in #88.

@malept malept added the in pr label Jan 16, 2017
@malept malept self-assigned this Jan 16, 2017
malept added a commit that referenced this issue Jan 16, 2017
@malept
Copy link
Member

malept commented Jan 16, 2017

This should be fixed in 2.7.1, thanks for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants