Validation error: Module /node_modules/@nx/jest/plugins/resolver in the resolver option was not found

I am upgrading my Angular project from v14 to v17 and upgraded many of my other packages in the process. One of these packages was Jest v26 to v29.

I have been having a lot of issues with this, but right now I can’t even run my Jest tests without getting the error:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>● Validation Error:
Module <rootDir>/node_modules/@nx/jest/plugins/resolver in the resolver option was not found.
<rootDir> is: C:UsersIM010907DocumentsgitDashboardID_Client
</code>
<code>● Validation Error: Module <rootDir>/node_modules/@nx/jest/plugins/resolver in the resolver option was not found. <rootDir> is: C:UsersIM010907DocumentsgitDashboardID_Client </code>
● Validation Error:

  Module <rootDir>/node_modules/@nx/jest/plugins/resolver in the resolver option was not found.
         <rootDir> is: C:UsersIM010907DocumentsgitDashboardID_Client

My jest.config.ts looks as follows:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>// If you update settings here, each individual app/librarys jest config also needs to be updated
/** @type {import('jest').Config} */
const config = {
preset: 'jest-preset-angular',
// resolves our fancy file paths: i.e. @icm/models -> libs/models/src/index.ts
resolver: '<rootDir>/node_modules/@nx/jest/plugins/resolver',
// files to run before compilation, set up globals
setupFiles: [
// mock's canvas used in charts
'jest-canvas-mock',
'config/jest-setup.js'
],
// setup for the actual tests, declaring global mocks
setupFilesAfterEnv: [
'config/jest-setup-after-env.js'
],
moduleNameMapper: {
'^lodash-es$' : 'lodash'
},
modulePathIgnorePatterns: [
'node_modules',
'libs/charts/src/lib/components/chart/*/*.js'
],
// this setting allows us to ignore most node_module things in tests but correctly use imported modules
// https://jestjs.io/docs/tutorial-react-native#transformignorepatterns-customization
// https://github.com/thymikee/jest-preset-angular/blob/c8211760c782ccd2be071a4f1ee38edef29657b7/website/docs/guides/angular-13%2B.md
transformIgnorePatterns: ['node_modules/(?!(.*\.mjs$|@justinribeiro))'],
transform: {
'^.+\.ts?$': 'ts-jest',
},
testRegex: '(/__tests__/.*|(\.|/)(test|spec))\.ts?$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
verbose: true,
};
module.exports = config;
</code>
<code>// If you update settings here, each individual app/librarys jest config also needs to be updated /** @type {import('jest').Config} */ const config = { preset: 'jest-preset-angular', // resolves our fancy file paths: i.e. @icm/models -> libs/models/src/index.ts resolver: '<rootDir>/node_modules/@nx/jest/plugins/resolver', // files to run before compilation, set up globals setupFiles: [ // mock's canvas used in charts 'jest-canvas-mock', 'config/jest-setup.js' ], // setup for the actual tests, declaring global mocks setupFilesAfterEnv: [ 'config/jest-setup-after-env.js' ], moduleNameMapper: { '^lodash-es$' : 'lodash' }, modulePathIgnorePatterns: [ 'node_modules', 'libs/charts/src/lib/components/chart/*/*.js' ], // this setting allows us to ignore most node_module things in tests but correctly use imported modules // https://jestjs.io/docs/tutorial-react-native#transformignorepatterns-customization // https://github.com/thymikee/jest-preset-angular/blob/c8211760c782ccd2be071a4f1ee38edef29657b7/website/docs/guides/angular-13%2B.md transformIgnorePatterns: ['node_modules/(?!(.*\.mjs$|@justinribeiro))'], transform: { '^.+\.ts?$': 'ts-jest', }, testRegex: '(/__tests__/.*|(\.|/)(test|spec))\.ts?$', moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], verbose: true, }; module.exports = config; </code>
// If you update settings here,  each individual app/librarys jest config also needs to be updated
/** @type {import('jest').Config} */
const config = {
  preset: 'jest-preset-angular',
  // resolves our fancy file paths: i.e. @icm/models -> libs/models/src/index.ts
  resolver: '<rootDir>/node_modules/@nx/jest/plugins/resolver',
  // files to run before compilation, set up globals
  setupFiles: [
    // mock's canvas used in charts
      'jest-canvas-mock',
    'config/jest-setup.js'
  ],
    // setup for the actual tests, declaring global mocks
    setupFilesAfterEnv: [
      'config/jest-setup-after-env.js'
    ],
    moduleNameMapper: {
      '^lodash-es$' : 'lodash'
    },
    modulePathIgnorePatterns: [
      'node_modules',
      'libs/charts/src/lib/components/chart/*/*.js'
    ],
    // this setting allows us to ignore most node_module things in tests but correctly use imported modules
    // https://jestjs.io/docs/tutorial-react-native#transformignorepatterns-customization
    // https://github.com/thymikee/jest-preset-angular/blob/c8211760c782ccd2be071a4f1ee38edef29657b7/website/docs/guides/angular-13%2B.md
    transformIgnorePatterns: ['node_modules/(?!(.*\.mjs$|@justinribeiro))'],
    transform: {
      '^.+\.ts?$': 'ts-jest',
    },
    testRegex: '(/__tests__/.*|(\.|/)(test|spec))\.ts?$',
    moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
  verbose: true,
};

module.exports = config;

I have tried setting it to @nx/jest/plugins/resolver, ../node_modules/@nx/jest/plugins/resolver and basically every other combination that makes sense.

Thanks in advance for any information you may have!

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật