[Makefile:902: generate-images] Error 1 #10219

Closed
opened 2025-11-02 09:01:18 -06:00 by GiteaMirror · 12 comments
Owner

Originally created by @jelebruh on GitHub (Feb 5, 2023).

Description

I want to generate images. Type make generate-images.
I get

npm ERR! code 1
npm ERR! path /home/gitea/test/gitea-1.18.3/node_modules/zopflipng-bin
npm ERR! command failed
npm ERR! command sh -c node lib/install.js
npm ERR! A complete log of this run can be found in:
npm ERR!     /home/gitea/.npm/_logs/2023-02-05T17_42_34_758Z-debug-0.log

Full log below

npm 9.3.1
nodejs 18.14
go 1.19.5

Gitea Version

1.19.0-dev, builded 4 feb., also tested 1.18.3 in releases

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

https://jelebruh.xyz/cfiles/gitealog.txt

Screenshots

No response

Git Version

No response

Operating System

Ubuntu 22.04

How are you running Gitea?

Service with binary

Database

PostgreSQL

Originally created by @jelebruh on GitHub (Feb 5, 2023). ### Description I want to generate images. Type `make generate-images`. I get ``` npm ERR! code 1 npm ERR! path /home/gitea/test/gitea-1.18.3/node_modules/zopflipng-bin npm ERR! command failed npm ERR! command sh -c node lib/install.js npm ERR! A complete log of this run can be found in: npm ERR! /home/gitea/.npm/_logs/2023-02-05T17_42_34_758Z-debug-0.log ``` Full log below npm 9.3.1 nodejs 18.14 go 1.19.5 ### Gitea Version 1.19.0-dev, builded 4 feb., also tested 1.18.3 in releases ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist https://jelebruh.xyz/cfiles/gitealog.txt ### Screenshots _No response_ ### Git Version _No response_ ### Operating System Ubuntu 22.04 ### How are you running Gitea? Service with binary ### Database PostgreSQL
GiteaMirror added the type/question label 2025-11-02 09:01:18 -06:00
Author
Owner

@yardenshoham commented on GitHub (Feb 5, 2023):

It works for me (developing on Gitpod)

@yardenshoham commented on GitHub (Feb 5, 2023): It works for me (developing on Gitpod)
Author
Owner

@techknowlogick commented on GitHub (Feb 5, 2023):

What does the complete log in /home/gitea/.npm/_logs/2023-02-05T17_42_34_758Z-debug-0.log say?

@techknowlogick commented on GitHub (Feb 5, 2023): What does the complete log in /home/gitea/.npm/_logs/2023-02-05T17_42_34_758Z-debug-0.log say?
Author
Owner

@jelebruh commented on GitHub (Feb 5, 2023):

What does the complete log in /home/gitea/.npm/_logs/2023-02-05T17_42_34_758Z-debug-0.log say?

check log gist, this is it

@jelebruh commented on GitHub (Feb 5, 2023): > What does the complete log in /home/gitea/.npm/_logs/2023-02-05T17_42_34_758Z-debug-0.log say? check log gist, this is it
Author
Owner

@techknowlogick commented on GitHub (Feb 5, 2023):

@KOT4N Ah, my apologies, I missed that.

@techknowlogick commented on GitHub (Feb 5, 2023): @KOT4N Ah, my apologies, I missed that.
Author
Owner

@wxiaoguang commented on GitHub (Feb 6, 2023):

It doesn't seem to be related to Gitea. But it's highly likely to be related to NPM or your SNAP or package zopflipng-bin

Use a native nodejs installation to have a try.

@wxiaoguang commented on GitHub (Feb 6, 2023): It doesn't seem to be related to Gitea. But it's highly likely to be related to NPM or your SNAP or package zopflipng-bin Use a native nodejs installation to have a try.
Author
Owner

@jelebruh commented on GitHub (Feb 6, 2023):

Use a native nodejs installation to have a try.

Sorry, but idk how to do it.
I reinstall node and get
https://jelebruh.xyz/cfiles/gitealog2.txt

@jelebruh commented on GitHub (Feb 6, 2023): > Use a native nodejs installation to have a try. Sorry, but idk how to do it. I reinstall node and get https://jelebruh.xyz/cfiles/gitealog2.txt
Author
Owner

@wxiaoguang commented on GitHub (Feb 6, 2023):

It seems that your local package cache might be broken. A fresh clone & make always succeed.

According your error message, there is no canvas package on your side. You may try to manually install it:

npm install --no-save --no-package-lock fabric@5 imagemin-zopfli@7 canvas@2
node build/generate-images.js
@wxiaoguang commented on GitHub (Feb 6, 2023): It seems that your local package cache might be broken. A fresh clone & make always succeed. According your error message, there is no `canvas` package on your side. You may try to manually install it: ``` npm install --no-save --no-package-lock fabric@5 imagemin-zopfli@7 canvas@2 node build/generate-images.js ```
Author
Owner

@jelebruh commented on GitHub (Feb 6, 2023):

npm install --no-save --no-package-lock fabric@5 imagemin-zopfli@7 canvas@2
node build/generate-images.js

I clear /home, delete repo folder, reinstall node with purge all libs and get HTMLConvasElement again

@jelebruh commented on GitHub (Feb 6, 2023): > ``` > npm install --no-save --no-package-lock fabric@5 imagemin-zopfli@7 canvas@2 > node build/generate-images.js > ``` I clear `/home`, delete repo folder, reinstall node with purge all libs and get HTMLConvasElement again
Author
Owner

@wxiaoguang commented on GitHub (Feb 6, 2023):

No more idea from my side because I can not reproduce it.

ps: HTMLConvasElement is provided by the canvas package, it seems that you are near to succeed, but I do not know whether there are other factors affecting in your environment.

@wxiaoguang commented on GitHub (Feb 6, 2023): No more idea from my side because I can not reproduce it. ps: HTMLConvasElement is provided by the `canvas` package, it seems that you are near to succeed, but I do not know whether there are other factors affecting in your environment.
Author
Owner

@jelebruh commented on GitHub (Feb 6, 2023):

Maybe I help anyone with my solution
I scan logs and what understand:
Need gulp
Need canvas

I'm use npm install canvas, get HTML error.
Install gulp, get errors. Then I google error, found solution.
npm install gulp@4.0.2 --force
Try again npm install canvas, get HTML error again.
I google canvas and found method in wiki.
sudo apt-get update
sudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
Then npm install canvas and it works without error.

After this make generate-images worked normally.

@jelebruh commented on GitHub (Feb 6, 2023): Maybe I help anyone with my solution I scan logs and what understand: Need gulp Need canvas I'm use `npm install canvas`, get HTML error. Install `gulp`, get errors. Then I google error, found solution. `npm install gulp@4.0.2 --force` Try again `npm install canvas`, get HTML error again. I google `canvas` and found method in wiki. `sudo apt-get update` `sudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev` Then `npm install canvas` and it works without error. After this `make generate-images` worked normally.
Author
Owner

@jelebruh commented on GitHub (Feb 6, 2023):

Close as completed, thanks everyone for the tip and help.

@jelebruh commented on GitHub (Feb 6, 2023): Close as completed, thanks everyone for the tip and help.
Author
Owner

@wxiaoguang commented on GitHub (Feb 6, 2023):

I think I understand the problem now.

canvas package will download the binaries for supported OS/arch automatically. So in most cases, developers do not need to do anything manually. At the moment, only macOS/Linux/Windows on x64 are supported. https://github.com/Automattic/node-canvas/releases

However, if you are using an unsupported OS/arch (or build from source, or something else doesn't match the pre-built release), then you need to install the lib*-dev packages to make npm build the packages from source.

@wxiaoguang commented on GitHub (Feb 6, 2023): I think I understand the problem now. `canvas` package will download the binaries for supported OS/arch automatically. So in most cases, developers do not need to do anything manually. At the moment, only macOS/Linux/Windows on x64 are supported. https://github.com/Automattic/node-canvas/releases However, if you are using an unsupported OS/arch (or build from source, or something else doesn't match the pre-built release), then you need to install the `lib*-dev` packages to make npm build the packages from source.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#10219