onlyotdn commented on issue #2843:
URL: 
https://github.com/apache/incubator-streampark/issues/2843#issuecomment-1629926069

   > @onlyotdn We have located the cause of the error, and it does cause a 
blank page bug after compilation. The temporary solution is to modify 
incubator-streampark/streampark-console/streampark-console-service/pom.xml#L605
   > 
   > ```
   > <executions>
   >     <execution>
   >         <id>install node and npm</id>
   >         <goals>
   >             <goal>install-node-and-npm</goal>
   >         </goals>
   >         <configuration>
   >             <nodeVersion>v16.16.0</nodeVersion>
   >             <npmVersion>8.11.0</npmVersion>
   >         </configuration>
   >     </execution>
   >     <execution>
   >         <id>install</id>
   >         <goals>
   >             <goal>npm</goal>
   >         </goals>
   >         <phase>generate-resources</phase>
   >         <configuration>
   >             <arguments>install</arguments>
   >         </configuration>
   >     </execution>
   >     <execution>
   >         <id>build</id>
   >         <goals>
   >             <goal>npm</goal>
   >         </goals>
   >         <configuration>
   >             <arguments>run build:no-cache</arguments>
   >         </configuration>
   >     </execution>
   > </executions>
   > ```
   > 
   > Reference PR: #2845
   
   I pulled the code from the latest dev branch to replace the local, and 
executed npm install under the webapp project, and always reported an error
   ```
   npm ERR! path 
/Users/xxx/IdeaProjects/incubator-streampark/streampark-console/streampark-console-webapp/node_modules/pngquant-bin
   npm ERR! command failed
   npm ERR! command sh -c node lib/install.js
   npm ERR! compiling from source
   npm ERR! connect ECONNREFUSED 0.0.0.0:443
   npm ERR! pngquant pre-build test failed
   npm ERR! Error: pngquant failed to build, make sure that libpng is installed
   ```
   
   I tried various ways, including executing brew install libpng but the error 
message is still the same, I found brew install pkg-config from stackoverflow, 
but it reported a new error
   
   ```
   npm ERR! path 
/Users/xxxx/IdeaProjects/incubator-streampark/streampark-console/streampark-console-webapp/node_modules/optipng-bin
   npm ERR! command failed
   npm ERR! command sh -c node lib/install.js
   npm ERR! compiling from source
   npm ERR! connect ECONNREFUSED 0.0.0.0:443
   npm ERR! optipng pre-build test failed
   npm ERR! Error: Command failed: /bin/sh -c make install
   npm ERR! pngrtran.c:99:1: warning: unused function 'png_rtran_ok' 
[-Wunused-function]
   npm ERR! png_rtran_ok(png_structrp png_ptr, int need_IHDR)
   npm ERR! ^
   npm ERR! 1 warning generated.
   npm ERR! pngrutil.c:3536:20: warning: performing pointer subtraction with a 
null pointer has undefined behavior [-Wnull-pointer-subtraction]
   npm ERR!                    png_isaligned(dp, png_uint_16) &&
   npm ERR!                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   npm ERR! ./pngpriv.h:597:29: note: expanded from macro 'png_isaligned'
   npm ERR!    (((type)((const char*)ptr-(const char*)0) & \
   npm ERR!                             ^~~~~~~~~~~~~~~
   npm ERR! pngrutil.c:3537:20: warning: performing pointer subtraction with a 
null pointer has undefined behavior [-Wnull-pointer-subtraction]
   npm ERR!                    png_isaligned(sp, png_uint_16) &&
   npm ERR!                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   npm ERR! ./pngpriv.h:597:29: note: expanded from macro 'png_isaligned'
   npm ERR!    (((type)((const char*)ptr-(const char*)0) & \
   npm ERR!                             ^~~~~~~~~~~~~~~
   npm ERR! pngrutil.c:3544:23: warning: performing pointer subtraction with a 
null pointer has undefined behavior [-Wnull-pointer-subtraction]
   npm ERR!                   if (png_isaligned(dp, png_uint_32) &&
   npm ERR!                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   npm ERR! ./pngpriv.h:597:29: note: expanded from macro 'png_isaligned'
   npm ERR!    (((type)((const char*)ptr-(const char*)0) & \
   npm ERR!                             ^~~~~~~~~~~~~~~
   npm ERR! pngrutil.c:3545:23: warning: performing pointer subtraction with a 
null pointer has undefined behavior [-Wnull-pointer-subtraction]
   npm ERR!                       png_isaligned(sp, png_uint_32) &&
   npm ERR!                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   npm ERR! ./pngpriv.h:597:29: note: expanded from macro 'png_isaligned'
   npm ERR!    (((type)((const char*)ptr-(const char*)0) & \
   npm ERR!                             ^~~~~~~~~~~~~~~
   npm ERR! pngrutil.c:4604:34: warning: performing pointer subtraction with a 
null pointer has undefined behavior [-Wnull-pointer-subtraction]
   npm ERR!          int extra = (int)((temp - (png_bytep)0) & 0x0f);
   npm ERR!                                  ^ ~~~~~~~~~~~~
   npm ERR! pngrutil.c:4608:30: warning: performing pointer subtraction with a 
null pointer has undefined behavior [-Wnull-pointer-subtraction]
   npm ERR!          extra = (int)((temp - (png_bytep)0) & 0x0f);
   npm ERR!                              ^ ~~~~~~~~~~~~
   npm ERR! 6 warnings generated.
   npm ERR! ld: warning: option -s is obsolete and being ignored
   npm ERR! Undefined symbols for architecture arm64:
   npm ERR!   "_png_init_filter_functions_neon", referenced from:
   npm ERR!       _png_read_filter_row in libpng.a(pngrutil.o)
   npm ERR! ld: symbol(s) not found for architecture arm64
   npm ERR! clang: error: linker command failed with exit code 1 (use -v to see 
invocation)
   npm ERR! make[1]: *** [optipng] Error 1
   npm ERR! make: *** [install] Error 2
   npm ERR! 
   npm ERR! cd src/optipng && \
   npm ERR!        /Library/Developer/CommandLineTools/usr/bin/make install && \
   npm ERR!        cd ../..
   npm ERR! cd ../libpng && \
   npm ERR!        /Library/Developer/CommandLineTools/usr/bin/make -f Makefile 
PNGLIBCONF_H_PREBUILT=pnglibconf.h.optipng && \
   npm ERR!        cd ../optipng
   npm ERR! cp pnglibconf.h.optipng pnglibconf.h
   npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o png.o png.c
   npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngerror.o pngerror.c
   npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngget.o pngget.c
   npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngmem.o pngmem.c
   npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngpread.o pngpread.c
   npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngread.o pngread.c
   npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngrio.o pngrio.c
   npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngrtran.o pngrtran.c
   npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngrutil.o pngrutil.c
   npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngset.o pngset.c
   npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngtrans.o pngtrans.c
   npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngwio.o pngwio.c
   npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngwrite.o pngwrite.c
   npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngwtran.o pngwtran.c
   npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngwutil.o pngwutil.c
   npm ERR! ar rcs libpng.a png.o pngerror.o pngget.o pngmem.o pngpread.o 
pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o pngtrans.o pngwio.o 
pngwrite.o pngwtran.o pngwutil.o
   npm ERR! ranlib libpng.a
   npm ERR! gcc -c -I../zlib  -O2 -Wall -Wextra -o pngtest.o pngtest.c
   npm ERR! gcc  -L../zlib -o pngtest pngtest.o libpng.a -lz -lm
   npm ERR! cd ../opngreduc && \
   npm ERR!        /Library/Developer/CommandLineTools/usr/bin/make -f Makefile 
libopngreduc.a && \
   npm ERR!        cd ../optipng
   npm ERR! gcc -c  -O2 -Wall -Wextra  -I../libpng -o opngreduc.o opngreduc.c
   npm ERR! ar cru libopngreduc.a opngreduc.o
   npm ERR! ranlib libopngreduc.a
   npm ERR! cd ../gifread && \
   npm ERR!        /Library/Developer/CommandLineTools/usr/bin/make -f Makefile 
libgifread.a && \
   npm ERR!        cd ../optipng
   npm ERR! gcc -c  -O2 -Wall -Wextra -o gifread.o gifread.c
   npm ERR! ar cru libgifread.a gifread.o
   npm ERR! ranlib libgifread.a
   npm ERR! cd ../pnmio && \
   npm ERR!        /Library/Developer/CommandLineTools/usr/bin/make -f Makefile 
libpnmio.a && \
   npm ERR!        cd ../optipng
   npm ERR! gcc -c  -O2 -Wall -Wextra -o pnmin.o pnmin.c
   npm ERR! gcc -c  -O2 -Wall -Wextra -o pnmout.o pnmout.c
   npm ERR! gcc -c  -O2 -Wall -Wextra -o pnmutil.o pnmutil.c
   npm ERR! ar cru libpnmio.a pnmin.o pnmout.o pnmutil.o
   npm ERR! ranlib libpnmio.a
   npm ERR! cd ../minitiff && \
   npm ERR!        /Library/Developer/CommandLineTools/usr/bin/make -f Makefile 
libminitiff.a && \
   npm ERR!        cd ../optipng
   npm ERR! gcc -c  -O2 -Wall -Wextra -o tiffread.o tiffread.c
   npm ERR! gcc -c  -O2 -Wall -Wextra -o tiffutil.o tiffutil.c
   npm ERR! ar cru libminitiff.a tiffread.o tiffutil.o 
   npm ERR! ranlib libminitiff.a
   npm ERR! cd ../pngxtern && \
   npm ERR!        /Library/Developer/CommandLineTools/usr/bin/make -f Makefile 
libpngxtern.a && \
   npm ERR!        cd ../optipng
   npm ERR! gcc -c  -O2 -Wall -Wextra  -I../libpng -I../gifread -I../pnmio 
-I../minitiff -o pngxread.o pngxread.c
   npm ERR! gcc -c  -O2 -Wall -Wextra  -I../libpng -I../gifread -I../pnmio 
-I../minitiff -o pngxrbmp.o pngxrbmp.c
   npm ERR! gcc -c  -O2 -Wall -Wextra  -I../libpng -I../gifread -I../pnmio 
-I../minitiff -o pngxrgif.o pngxrgif.c
   npm ERR! gcc -c  -O2 -Wall -Wextra  -I../libpng -I../gifread -I../pnmio 
-I../minitiff -o pngxrjpg.o pngxrjpg.c
   npm ERR! gcc -c  -O2 -Wall -Wextra  -I../libpng -I../gifread -I../pnmio 
-I../minitiff -o pngxrpnm.o pngxrpnm.c
   npm ERR! gcc -c  -O2 -Wall -Wextra  -I../libpng -I../gifread -I../pnmio 
-I../minitiff -o pngxrtif.o pngxrtif.c
   npm ERR! gcc -c  -O2 -Wall -Wextra  -I../libpng -I../gifread -I../pnmio 
-I../minitiff -o pngxio.o pngxio.c
   npm ERR! gcc -c  -O2 -Wall -Wextra  -I../libpng -I../gifread -I../pnmio 
-I../minitiff -o pngxmem.o pngxmem.c
   npm ERR! gcc -c  -O2 -Wall -Wextra  -I../libpng -I../gifread -I../pnmio 
-I../minitiff -o pngxset.o pngxset.c
   npm ERR! ar cru libpngxtern.a pngxread.o pngxrbmp.o pngxrgif.o pngxrjpg.o 
pngxrpnm.o pngxrtif.o pngxio.o pngxmem.o pngxset.o
   npm ERR! ranlib libpngxtern.a
   npm ERR! gcc -c  -O2 -Wall -Wextra -I../cexcept  -I../libpng -I../opngreduc 
-I../pngxtern -o optipng.o optipng.c
   npm ERR! gcc -c  -O2 -Wall -Wextra -I../cexcept  -I../libpng -I../opngreduc 
-I../pngxtern -o optim.o optim.c
   npm ERR! gcc -c  -O2 -Wall -Wextra -I../cexcept  -I../libpng -I../opngreduc 
-I../pngxtern -o bitset.o bitset.c
   npm ERR! gcc -c  -O2 -Wall -Wextra -I../cexcept  -I../libpng -I../opngreduc 
-I../pngxtern -o ioutil.o ioutil.c
   npm ERR! gcc -c  -O2 -Wall -Wextra -I../cexcept  -I../libpng -I../opngreduc 
-I../pngxtern -o ratio.o ratio.c
   npm ERR! gcc -c  -O2 -Wall -Wextra -I../cexcept  -I../libpng -I../opngreduc 
-I../pngxtern -o wildargs.o wildargs.c
   npm ERR! gcc -s -o optipng optipng.o optim.o bitset.o ioutil.o ratio.o 
wildargs.o ../opngreduc/libopngreduc.a ../pngxtern/libpngxtern.a 
../libpng/libpng.a  ../gifread/libgifread.a ../pnmio/libpnmio.a 
../minitiff/libminitiff.a  -lz -lm 
   npm ERR! 
   npm ERR!     at 
/Users/xxx/IdeaProjects/incubator-streampark/streampark-console/streampark-console-webapp/node_modules/bin-build/node_modules/execa/index.js:231:11
   npm ERR!     at process.processTicksAndRejections 
(node:internal/process/task_queues:95:5)
   ```
   Then I judged whether the relationship between the apple arm64 architecture 
caused pkg-config to fail, and I saw from stackoverflow that the execution brew 
install pkg-config cairo pango libpng jpeg giflib librsvg
   npm install -g canvas, but it still doesn't work


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to