I am getting the following error while running test coverage in circleci build. I am not getting any errors and all tests pass while running the same command (npm run coverage) on my local machine.
#!/bin/bash -eo pipefail
npm run coverage
07 12 2021 15:27:50.681:INFO [karma]: Karma v1.7.1 server started at http://0.0.0.0:9876/
07 12 2021 15:27:50.682:INFO [launcher]: Launching browser CircleCI_ChromeHeadless with unlimited concurrency
07 12 2021 15:27:50.685:INFO [launcher]: Starting browser ChromeHeadless
07 12 2021 15:27:50.720:ERROR [launcher]: Cannot start ChromeHeadless
/home/circleci/project/node_modules/puppeteer/.local-chromium/linux-938248/chrome-linux/chrome: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory
07 12 2021 15:27:50.720:ERROR [launcher]: ChromeHeadless stdout:
07 12 2021 15:27:50.720:ERROR [launcher]: ChromeHeadless stderr: /home/circleci/project/node_modules/puppeteer/.local-chromium/linux-938248/chrome-linux/chrome: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory
07 12 2021 15:27:50.722:INFO [launcher]: Trying to start ChromeHeadless again (1/2).
07 12 2021 15:27:50.750:ERROR [launcher]: Cannot start ChromeHeadless
/home/circleci/project/node_modules/puppeteer/.local-chromium/linux-938248/chrome-linux/chrome: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory
07 12 2021 15:27:50.750:ERROR [launcher]: ChromeHeadless stdout:
07 12 2021 15:27:50.750:ERROR [launcher]: ChromeHeadless stderr: /home/circleci/project/node_modules/puppeteer/.local-chromium/linux-938248/chrome-linux/chrome: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory
07 12 2021 15:27:50.752:INFO [launcher]: Trying to start ChromeHeadless again (2/2).
07 12 2021 15:27:50.783:ERROR [launcher]: Cannot start ChromeHeadless
/home/circleci/project/node_modules/puppeteer/.local-chromium/linux-938248/chrome-linux/chrome: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory
npm ERR! A complete log of this run can be found in:
npm ERR! /home/circleci/.npm/_logs/2021-12-07T09_53_42_698Z-debug.log