После переноса проекта с версии Angular 8 на 10 я получаю следующую ошибку при выполнении модульных тестов:
ERROR in ./node_modules/fs.realpath/index.js
Module not found: Error: Can't resolve 'fs' in 'C:\Users\pp\Desktop\gns3-web-ui\node_modules\fs.realpath'
resolve 'fs' in 'C:\Users\pp\Desktop\gns3-web-ui\node_modules\fs.realpath'
Parsed request is a module
using description file: C:\Users\pp\Desktop\gns3-web-ui\node_modules\fs.realpath\package.json (relative path: .)
Field 'browser' doesn't contain a valid alias configuration
resolve as module
looking for modules in C:/Users/pp/Desktop/gns3-web-ui/src
using description file: C:\Users\pp\Desktop\gns3-web-ui\package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
using description file: C:\Users\pp\Desktop\gns3-web-ui\package.json (relative path: ./src/fs)
no extension
Field 'browser' doesn't contain a valid alias configuration
C:\Users\pp\Desktop\gns3-web-ui\src\fs doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
C:\Users\pp\Desktop\gns3-web-ui\src\fs.ts doesn't exist
.tsx
Field 'browser' doesn't contain a valid alias configuration
C:\Users\pp\Desktop\gns3-web-ui\src\fs.tsx doesn't exist
.mjs
Field 'browser' doesn't contain a valid alias configuration
C:\Users\pp\Desktop\gns3-web-ui\src\fs.mjs doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
C:\Users\pp\Desktop\gns3-web-ui\src\fs.js doesn't exist
as directory
C:\Users\pp\Desktop\gns3-web-ui\src\fs doesn't exist
@ ./node_modules/jasmine/node_modules/jasmine-core/lib/jasmine-core.js 5:9-22
@ ./node_modules/jasmine/lib/jasmine.js
@ ./src/app/app.component.spec.ts
@ ./src sync \.spec\.ts$
@ ./src/test.ts
Файл Tsconfig:
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"module": "esnext",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"target": "es5",
"types": ["jasmine", "jest", "mocha", "node"],
"typeRoots": [
"node_modules/@types"
],
// below is fix for angular-cli to support core-js >= 3.0
"paths": {
"core-js/es7/reflect": ["../node_modules/core-js/proposals/reflect-metadata"],
"core-js/es6/*": ["../node_modules/core-js/es/*"]
},
"lib": [
"es2018",
"dom"
],
},
"include": [
"./src/**/*",
]
}
Я просмотрел этот пост Поле 'browser' не содержит допустимой конфигурации псевдонима , к сожалению, это не помогло