'Not able to run Vue test getting @babel/traverse error

I am not able to run the test using jest in the Vue app

"test:unit": "vue-cli-service test:unit"

"devDependencies": {
    "@vue/cli-plugin-babel": "^4.5.0",
    "@vue/cli-plugin-eslint": "^4.5.0",
    "@vue/cli-plugin-router": "^4.5.0",
    "@vue/cli-plugin-vuex": "^4.5.0",
    "@vue/cli-plugin-unit-jest": "^5.0.4",
    "@vue/cli-service": "^4.5.0",
    "@vue/compiler-sfc": "^3.0.0",
    "@vue/eslint-config-standard": "^6.0.0",
    "@vue/test-utils": "^2.0.0-rc.17",
    "autoprefixer": "^9.8.6",
    "babel-eslint": "^10.1.0",
    "eslint": "^7.25.0",
    "eslint-config-standard": "^14.1.1",
    "eslint-plugin-import": "^2.20.2",
    "eslint-plugin-node": "^11.1.0",
    "eslint-plugin-promise": "^4.3.1",
    "eslint-plugin-standard": "^4.1.0",
    "eslint-plugin-vue": "^7.0.0",
    "jest": "^26.6.3",
    "postcss": "^7.0.36",
    "tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.2.4"
  }

Getting below error:

Error: Cannot find module '@babel/traverse'

Require stack:

  • /node_modules/jest-snapshot/build/InlineSnapshots.js
  • /node_modules/jest-snapshot/build/State.js
  • /node_modules/jest-snapshot/build/index.js
  • /node_modules/jest-runtime/build/index.js
  • /node_modules/@jest/core/build/cli/index.js
  • /node_modules/@jest/core/build/jest.js
  • /node_modules/@vue/cli-plugin-unit-jest/node_modules/jest/node_modules/jest-cli/build/cli/index.js
  • /node_modules/@vue/cli-plugin-unit-jest/node_modules/jest/node_modules/jest-cli/build/index.js
  • /node_modules/@vue/cli-plugin-unit-jest/node_modules/jest/build/jest.js
  • /node_modules/@vue/cli-plugin-unit-jest/index.js
  • /node_modules/@vue/cli-service/lib/Service.js
  • /node_modules/@vue/cli-service/bin/vue-cli-service.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:623:15) at Function.resolve (internal/modules/cjs/helpers.js:21:19) at Object. (/node_modules/jest-snapshot/build/InlineSnapshots.js:146:17) at Module._compile (internal/modules/cjs/loader.js:774:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10) at Module.load (internal/modules/cjs/loader.js:641:32) at Function.Module._load (internal/modules/cjs/loader.js:556:12) at Module.require (internal/modules/cjs/loader.js:681:19) at require (internal/modules/cjs/helpers.js:16:16) at Object. (/node_modules/jest-snapshot/build/State.js:27:24)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source