jenkins常见错误
- 构建报错
-
- 1. Error: pngquant failed to build, make sure that libpng-dev is installed
- 2. Error: Command failed: /bin/sh -c ./configure......configure: error: no nasm (Netwide Assembler) found
- 3. npm ERR! missing script: prod
- 4. ERROR: Exception when publishing, exception message [Failed to connect and initialize SSH connection. Message: [Failed to connect session for config [10.200.0.156]. Message [Auth fail]]]
- 5. FATAL ERROR: MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory
构建报错
1. Error: pngquant failed to build, make sure that libpng-dev is installed
解决方法
sudo yum -y group install "Development Tools"
sudo yum -y install libpng-devel
2. Error: Command failed: /bin/sh -c ./configure…configure: error: no nasm (Netwide Assembler) found
connect ECONNREFUSED 0.0.0.0:443
mozjpeg pre-build test failed
compiling from source
Error: Command failed: /bin/sh -c ./configure --enable-static --disable-shared --disable-dependency-tracking --with-jpeg8 --prefix="/var/lib/jenkins/workspace/html/node_modules/mozjpeg/vendor" --bindir="/var/lib/jenkins/workspace/html/node_modules/mozjpeg/vendor" --libdir="/var/lib/jenkins/workspace/html/node_modules/mozjpeg/vendor"
configure: error: no nasm (Netwide Assembler) found
解决方法
yum install build-essential nasm
3. npm ERR! missing script: prod
解决方法
- 修改打包指令: npm run prod
修改为 npm run build
4. ERROR: Exception when publishing, exception message [Failed to connect and initialize SSH connection. Message: [Failed to connect session for config [10.200.0.156]. Message [Auth fail]]]
原因:SSH连接错误
,重新添加测试
5. FATAL ERROR: MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory
原因:内存溢出问题
处理方法:修改npm打包指令
# npm run build 修改为 NODE_OPTIONS=--max-old-space-size=4096 npm run build
NODE_OPTIONS=--max-old-space-size=4096 npm run build