mongodb-js / electron-squirrel-startup

Default Squirrel.Windows event handler for your Electron apps.
Apache License 2.0
217 stars 41 forks source link

core.require is not a function #5

Closed mzmousa closed 8 years ago

mzmousa commented 8 years ago

I added the line if (require ('electron-squirrel-startup')) return; to the top of my electron app. I have all the required dependencies installed. However, I keep getting the error

TypeError: core.require is not a function

I am running electron v0.37.8 on a Windows 7 machine, node v.6.1.0 and npm v.3.8.9.

plrthink commented 8 years ago

not sure why this would happen? Everythings works fine for me on windows 10 with electron 0.36.6. I find this (https://discuss.atom.io/t/first-launch-of-electron/17511/2), hope it would be helpful.

mzmousa commented 8 years ago

Still nothing :cry: I removed the node_modules directory within electron-squirrel-startup and then did another npm install to no success. It's not so urgent for me anymore as I've figured out how to handle squirrel events myself, but it would still be nice if I knew the reason for this happening.

imlucas commented 8 years ago

note the errant space after require

if (require ('electron-squirrel-startup')) return;
mzmousa commented 8 years ago

I have literally never come across that before. Fuck, that makes me so mad, literally a space has driven me bat-shit crazy. Anyways, it works now, thank you so much :smile: