Open facekapow opened 7 years ago
Nevermind, it was my fault, I had some dead code that was settings global.window
to null
.
However, on fresh installs, regenerator-runtime
isn't depended upon, so that's still an issue.
@facekapow regenerator-runtime
is a devDependency
, from package babel-plugin-transform-regenerator
, it's added in appropriate package.json
section
It's required at runtime, it should be a regular dependency; npm
doesn't install devDependencies
when you do npm install <pkg>
.
@facekapow regenerator-runtime
not correctly packed with webpack
, need to investigate it
I'm having this issue using Vanilla Javascript implementation.
Version: 4.0.12 Electron Version: 1.6.11
var Sudoer = require('electron-sudo').default;
var sudoer = new Sudoer();
@littletinman did you run npm i
in your project directory? babel-runtime
now is bundled as dependency
@automation-stack I ran npm i
but nothing was shown, I ended up just running npm install regenerator-runtime --save
and that solved the problem.
I had this problem. I'm using a Mac so I had to open another tab in Terminal.app. You can just restart Terminal to be doubly sure.
$ rm -rf /node_modules .package-lock.json
$ npm install
When using npm install --save-dev @babel/plugin-transform-runtime
, you need to have npm install --save @babel/runtime
as a production dependency.
If this doesn't work for you try clearing the npm cache and then do npm install
. See if that fixes your problem.
For more information look here: https://babeljs.io/docs/en/babel-plugin-transform-runtime
When trying to run an Electron app that uses this, it complains about not being able to find
regenerator-runtime
. Inspecting the code ofdist/index.js
reveals that this is true,regenerator-runtime
is required but not depended upon.Ok, that's fine, I just installedregenerator-runtime
manually. Except, now it's throwing because it can't readMath
from null. Once again, inspectingdist/index.js
shows that it's trying to getMath
from awindow
global. I'm trying to useelectron-sudo
in the main process, is this it only supposed to be used in the renderer process?