opendevstack / ods-pipeline

Alternative ODS CI/CD pipeline based on Tekton / OpenShift Pipelines

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

npm-toolset tests fail with new release of ubi8 Node.js image

henninggross opened this issue · comments

Red Hat published new releases of a lot of ubi8 images (https://access.redhat.com/errata/RHBA-2023:0132) on 2023-01-12 which includes ubi8/nodejs-16 and ubi8/nodejs-18.

This causes our tests which invoke jest via npx to fail with the following error:

> src@1.0.0 test
> JEST_JUNIT_OUTPUT_DIR='build/test-results/test' JEST_JUNIT_OUTPUT_NAME='report.xml' npx jest --reporters=default --reporters=jest-junit --coverage --coverageDirectory=build/coverage --forceExit

npm ERR! code ENOENT
npm ERR! syscall lstat
npm ERR! path /opt/app-root/src/.npm-global
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, lstat '/opt/app-root/src/.npm-global'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

Using the previous release of ubi8/nodejs-16 via FROM registry.access.redhat.com/ubi8/nodejs-16:1-72 does not produce this error.

However it seems that all previous releases of ubi8/nodejs-18 produce this error, but further investigation is needed.

Nice! I ran both images, and then executed npx in them.

I think mkdir -p /opt/app-root/src/.npm-global/lib fixes the issue for the newer images. I believe this has to do with the newer version of NPM (8.19.2 instead of 8.15.0)