Closed SGarno closed 6 years ago
I did some tracking down....it appears that serve.js is trying to spawn electron. However, it cannot find electron in the path. I installed electron globally and it is available at the command line, but still doesn't run using develop. I had to hard code the path for the electron.exe and then it does operate.
Thoughts?
Hi,
Normally after installing all deps, the electron
binary should be installed under node_modules/.bin/electron
.
It works fine with yarn 1.7.0
and npm 6.1.0
here under macOS.
Just skimmed through your log and I see you have npm
6 too, so it should work. Is it possible that npm
does not link binaries to node_modules/.bin
only on Windows?
OK not sure why there is a difference in behavior on Windows and macOS, so I just reverted the last merged PR that introduced this regression.
Please run the following to reset your git to the most recent master if you have no other changes in the cloned repo:
git fetch && git reset --hard origin/master
= or =
Alternatively trash currently cloned repo and clone from scratch:
git clone --depth=1 git@github.com:jschr/electron-react-redux-boilerplate.git
= or =
if you already have some changes in the cloned repo, you can simply checkout the previously working version of serve.js
:
https://github.com/jschr/electron-react-redux-boilerplate/blob/master/scripts/serve.js
Thanks for reporting this! 🥇
Thanks! This latest repo fixed the issue and it also seems to correct the CSP warnings. I was looking at fixing them...but looks like you did that too! :)
BTW: I updated the app to provide a logout button....thought it might be useful in your boilerplate so that you can get back to the main page. What are your plans for this project? Are you going to do anything more?
A logout button sounds useful–feel free to submit a PR and we'll review!
At this point we are mostly just keeping dependencies up to date and not considering adding any new features or tooling. I like the idea of keeping this boilerplate as minimal and unopinionated as possible.
There are much more feature-rich electron / react boilerplates out there but I think this project better serves users who may be new to electron and would prefer to avoid overwhelming them with a ton of additional tooling. There's already enough to learn with electron alone.
There are also a couple good examples of production apps built on top of this boilerplate (one of which is built by @pronebird and his team) when you are ready to dive deeper.
This repo also serves as a good place for people to ask questions. We try our best to debug with them or at least direct them to a more appropriate place to get help.
First off....many thanks for putting this together.....just what I have been looking for.
I just cloned a copy of the boilerplate and getting an error when running develop in private:serve. I am running this on Windows 10 x64.
pack:win seems to be fine.
Am I missing something in the configuration, environment or a dependency?
Error log detail:
13 verbose stack Error: electron-react-redux-boilerplate@0.0.0 private:serve: (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:304:16)
13 verbose stack at EventEmitter.emit (events.js:182:13)
13 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:182:13)
13 verbose stack at maybeClose (internal/child_process.js:961:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:5)
14 verbose pkgid electron-react-redux-boilerplate@0.0.0
15 verbose cwd D:\Development\Prototypes\electron-react-redux-boilerplate
16 verbose Windows_NT 10.0.17134
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "private:serve"
18 verbose node v10.3.0
19 verbose npm v6.1.0
20 error code ELIFECYCLE
21 error errno 1
22 error electron-react-redux-boilerplate@0.0.0 private:serve:
babel-node scripts/serve.js
13 verbose stack Exit status 1 13 verbose stack at EventEmitter.babel-node scripts/serve.js
22 error Exit status 1 23 error Failed at the electron-react-redux-boilerplate@0.0.0 private:serve script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 1, true ]npm output:
events.js:167 throw er; // Unhandled 'error' event ^
Error: spawn electron ENOENT at Process.ChildProcess._handle.onexit (internal/child_process.js:229:19) at onErrorNT (internal/child_process.js:406:16) at process._tickCallback (internal/process/next_tick.js:63:19) Emitted 'error' event at: at Process.ChildProcess._handle.onexit (internal/child_process.js:235:12) at onErrorNT (internal/child_process.js:406:16) at process._tickCallback (internal/process/next_tick.js:63:19) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! electron-react-redux-boilerplate@0.0.0 private:serve:
babel-node scripts/serve.js
npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the electron-react-redux-boilerplate@0.0.0 private:serve script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.