-
Notifications
You must be signed in to change notification settings - Fork 137
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
Cannot read property 'once' of undefined #137
Comments
Can you post your scripts from |
@codecounselor Thank you. I run it at Node but not electron. |
I get the same error when using electron to run the app. What am I doing wrong? Here is my package.json
|
You should have a script that looks like this |
Probably unrelated, but I see that you have electron |
I tried both those suggestions. Changed my package.json to look like:
and my app.js like this:
Do I need to install electron globally in a specific way, dont know what is going wrong here since Im starting the app with electron. I was debugging your lib/index.js file and logged the electron variable and got this path to a .exe BTW thank you for your help |
Do you have a working example somewhere? |
That looks right to me, you are running Which version of npm are you using? I think 3+ should dedup dependencies and electron should be in ./node_modules/electron and not nested under Perhaps that is your problem. |
And I don't have a public example of an API server, but perhaps I will publish one. |
Is this package compatible with windows? |
Yes it runs on windows, but you have to run |
When start the project by express.
/Users/lxxyx/Desktop/own/yun-type/node_modules/electron-pdf/lib/index.js:32
electronApp.once('ready', () => {
^
TypeError: Cannot read property 'once' of undefined
at PDFExporter.start (/Users/lxxyx/Desktop/own/yun-type/node_modules/electron-pdf/lib/index.js:32:16)
at Object. (/Users/lxxyx/Desktop/own/yun-type/js_server/app.js:22:10)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3
The text was updated successfully, but these errors were encountered: