msokk / electron-render-service

Microservice for rendering PDF/PNG/JPEG from HTML with Electron
MIT License
102 stars 31 forks source link

Electron failed to install correctly, please delete node_modules/electron and try installing again #44

Closed tdmike closed 6 years ago

tdmike commented 7 years ago

When installing electron-render-service through npm I run into an error which causes electron not being able to run.

https://pastebin.com/VEKLSj7Y

On request I can post the full verbose logging, I have already tried npm cache clean but that doesn't do anything either.

msokk commented 7 years ago

Hmm, looks like some permissions thing - check if node_modules file permissions and the user matches?

tdmike commented 7 years ago

Could you elaborate a little, I'm new to this.

Reggino commented 7 years ago

See https://stackoverflow.com/questions/18136746/npm-install-failed-with-cannot-run-in-wd

LordAro commented 7 years ago

I've also got this issue. Doesn't appear to be a permissions issue, as I'm running the thing as root (unless I'm misunderstanding something)

LordAro commented 7 years ago

From the looks of things, for some reason the npm install isn't running electron's postinstall hook?

msokk commented 7 years ago

Hmm, are you running npm v5?

LordAro commented 7 years ago

Nope, just Ubuntu 16.04 "defaults":

root@mediawiki-test:/usr/local/lib# npm --version
3.5.2
root@mediawiki-test:/usr/local/lib# node --version
v4.2.6
Reggino commented 7 years ago

You should not run or install dependencies as root. That should fix it ;-)

LordAro commented 7 years ago

It's a container being deployed with ansible - I don't care what it's running as, I just want it installed globally so I can actually run it vaguely easily

msokk commented 7 years ago

I didn't delve deep enough in the OP's pastebin, @LordAro could you try npm install --unsafe-perm -g electron-render-service

msokk commented 7 years ago

If that works I'll add it to package.json config.

LordAro commented 7 years ago

yeah, that works, as does running electron-render-service/node_modules/electron/install.js from the commandline