Skip to content
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

npm install error #101

Closed
wassfila opened this issue Feb 12, 2021 · 3 comments
Closed

npm install error #101

wassfila opened this issue Feb 12, 2021 · 3 comments

Comments

@wassfila
Copy link

wassfila commented Feb 12, 2021

could not npm install successfully.
Environment

  • Windows 10
  • node v14.15.1

commit : e43bd37

error on the postinstall step : electron-builder install-app-deps && husky install

I installed GTK manually, Note that the GTK bundles could not be downloaded from here https://github.com/Automattic/node-canvas/wiki/Installation%3A-Windows, the download is broken

I searched for cairo, and in this link the official GTK lin is also broken : https://www.cairographics.org/download/

after searching for a while from here : http://gladewin32.sourceforge.net/

but I still have missing dlls as not clear from where to get which version of GTK,
Warning: Missing input files:
C:\GTK\bin\libpng14-14.dll

I think then the npm install fallback on building and the dependencies errors start:
D:\Projects\zap\node_modules\canvas\src\register_font.h(3,10): fatal error C1083: Cannot open include file: 'pango/pango.h': No such file or directory

If possible to provide a hint if this is an electron install issue or which dependency do I have to focus on, the post install step is not clear to me.

Otherwise if this project is not currently building on all platforms if possible to provide the exact platform and dependencies versions built with so that I try to reproduce.

Any help would be appreciated.

@wassfila
Copy link
Author

Same error on ubuntu 20.04 and node v14.15.5

e43bd37

node-pre-gyp WARN Pre-built binaries not found for canvas@2.6.1 and electron@9.4.0 (electron-v9.4 ABI, glibc) (falling back to source compile with node-gyp

So I deleted this line from package.json

"postinstall": "electron-builder install-app-deps && husky install",

after that I could install and run successfully, this might not be the best fix though.

I'll leave this ticket open for info if you think that it should to be fixed

@tecimovic
Copy link
Collaborator

Yes.... There was a serious problem with the package versions since electron got updated to 9.4.
I tracked this down and backtracked the problem to sqlite3 upgrade to 5.0.0 which happened a while back, and with latest electron the situation completely exploded.

I have backed out of several upgrades, so now we are back to electron 8.2 and sqlite3 4.2.
Using node 14.15.5 is ok.

Note that on Linux you have to run src-script/install-packages-[ubuntu/fedora].

I had a bit of problem to recreate my dev environment after the downgrade, so I suggest:
1.) rm -rf node_modules/
2.) npm ci
3.) check the doc/faq.md, it lists few things you need to run:
- src-script/npm-update-binary
- possibly some of those rebuild commands that faq.md lists.

This is one time thing, so once you get to the point of being able to run npm run zap normally (also try npm run gen and npm run test), you should be ok for a while.

@wassfila
Copy link
Author

Excellent, thanks a lot for the details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants