Cannot find namespace 'WebMidi' in Angular

I’m using Angular and WebMID also I’ve had this error locally before but managed to solve it

Cannot find namespace ‘WebMidi’

What I’ve done:

added "types": ["WebMidi"] under "compilerOptions" in all of my ts configuration files including tests.

added manually "@types/webmidi": "^2.0.6", inside my package.json under "devDependencies"

as told before I don’t get error of that kind of error running manually npm run test.

Now on CircleCI my tests fails and I get

Error: error TS2688: Cannot find type definition file for 'WebMidi'. The file is in the program because: Entry point of type library 'WebMidi' specified in compilerOptions

Here is my yml file ( it’s a circleCI template I’ve slightly modified )


version: 2.1
orbs:
  browser-tools: circleci/browser-tools@1.2.3
jobs:
  build:
    working_directory: ~/ng-project
    docker:
      - image: cimg/node:16.13.1-browsers
    steps:
      - browser-tools/install-chrome
      - browser-tools/install-chromedriver
      - run:
          command: |
            google-chrome --version
            chromedriver --version
          name: Check install
      - checkout
      - restore_cache:
          key: ng-project-{{ .Branch }}-{{ checksum "package-lock.json" }}
      - run: npm install
      - run: npm install --save-dev firebase-tools
      - run: npm install --save-dev @types/webmidi
      - save_cache:
          key: ng-project-{{ .Branch }}-{{ checksum "package-lock.json" }}
          paths:
            - "node_modules"
      - run:
          name: "Run test"
          command: npm run test
      - run:
          name: "Build application for production"
          command: npm run build
      - run:
          name: "Deploy app to Firebase Hosting"
          command: "./node_modules/.bin/firebase deploy --token=$FIREBASE_TOKEN"

Many thanks in advance for your help