# Problem to run tests with command 'npm run test' before code deployments

**URL:** <https://discuss.circleci.com/t/problem-to-run-tests-with-command-npm-run-test-before-code-deployments/42002>\
**Category:** Running Tests\
**Created:** [November 19, 2021, 12:29pm UTC](https://discuss.circleci.com/t/problem-to-run-tests-with-command-npm-run-test-before-code-deployments/42002 "2021-11-19T12:29:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![plcgi1](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/plcgi1/32/28702_2.png) [@plcgi1](https://discuss.circleci.com/u/plcgi1)\
**Post date:** [November 19, 2021, 12:29pm UTC](https://discuss.circleci.com/t/problem-to-run-tests-with-command-npm-run-test-before-code-deployments/42002/1 "2021-11-19T12:29:17Z")

</div>

Hi everyone  
Have a problem with test command  
Configuration

```auto
version: 2.1
orbs:
  node: circleci/node@4.1.0
...
jobs:
  initial-check:
    docker:
    - image: cimg/base:stable
    steps:
    - checkout
    - node/install
    - node/install-packages:
        cache-path: ~/project/node_modules
        override-ci-command: npm install
    - run: npm run test

```

The code “- run: npm run test” fires error

```auto
Test duration: 174 ms
Assertions count: 37 (verbosity: 2.85)
The following leaks were detected:DOMException, structuredClone
Lint: No issues

```

All tests successful on local machine

---

<div class="post-metadata">

**Author:** ![nbialostosky](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/nbialostosky/32/24962_2.png) [@nbialostosky](https://discuss.circleci.com/u/nbialostosky)\
**Post date:** [November 30, 2021, 3:02pm UTC](https://discuss.circleci.com/t/problem-to-run-tests-with-command-npm-run-test-before-code-deployments/42002/2 "2021-11-30T15:02:41Z")

</div>

Hi @plcgi1 – welcome to Discuss!

My guess as to why you aren’t seeing this locally is you are on a different version of Node locally. When you run the `node/install` command it’s going to install I think the latest version, when I tested it installed `v17.1.0`. I found the following:

![Screen Shot 2021-11-30 at 8.59.19 AM](https://global.discourse-cdn.com/circleci/original/3X/3/c/3c40032b54b7e9f62a41bac445d7050c7600ef67.png)

This seems to indicate that on Node 17 you’ll get that DOMException error you are seeing, it could also be why you are seeing the other leak as well.

Can you try installing the same version you have locally via the install command:

[https://circleci.com/developer/orbs/orb/circleci/node?version=4.1.0#commands-install](https://circleci.com/developer/orbs/orb/circleci/node?version=4.1.0#commands-install)

And see if that helps with your CI build?

Thanks!  
-Nick

---

<div class="post-metadata">

**Author:** ![EvgenyNasretdinov](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/evgenynasretdinov/32/29288_2.png) [@EvgenyNasretdinov](https://discuss.circleci.com/u/EvgenyNasretdinov)\
**Post date:** [January 28, 2022, 3:35pm UTC](https://discuss.circleci.com/t/problem-to-run-tests-with-command-npm-run-test-before-code-deployments/42002/3 "2022-01-28T15:35:38Z")

</div>

Thanks for your answer! I’ve got the same problem and after updating Node version on my local machine, Ive found out that the issue was with hapi js version 🙂
