Я использую React. После создания-реакции-приложения --typescript я добавил несколько библиотек в package.json, после чего я получил исключение во время выполнения.
TypeScript error in D:/catalog/node_modules/@types/node/globals.d.ts(223,11):
Interface 'NodeModule' cannot simultaneously extend types 'Module' and 'Module'.
Named property 'hot' of types 'Module' and 'Module' are not identical. TS2320
221 | declare var require: NodeRequire;
222 |
> 223 | interface NodeModule {
| ^
224 | exports: any;
225 | require: NodeRequireFunction;
226 | id: string;
Я попытался 1) удалить node_moduls / установить снова 2) очистить кеш
К счастью, мой проект собирается, но во время выполнения появляется исключение Мой пакет.json
{
"dependencies": {
"@types/bootstrap": "^4.2.0",
"@types/faker": "^4.1.4",
"@types/node": "12.11.2",
"@types/parcel-env": "^0.0.0",
"@types/ramda": "^0.25.48",
"@types/react-dom": "16.9.2",
"@types/react-router": "^4.4.3",
"@types/react-router-dom": "^4.3.1",
"@types/recompose": "^0.30.3",
"@types/styled-components": "4.1.16",
"react": "^16.10.2",
"react-dom": "^16.10.2",
"react-scripts": "3.2.0",
"remotedev": "^0.2.9",
"yarn-deduplicate": "^1.1.1"
},
"devDependencies": {
"@types/react": "16.8.19",
"@types/enzyme": "^3.9.0",
"@types/enzyme-adapter-react-16": "^1.0.5",
"@types/jest": "^23.3.10",
"@types/webpack": "^4.4.24",
"@types/webpack-env": "^1.13.6",
"awesome-typescript-loader": "^5.2.1",
"cross-env": "^5.2.0",
"enzyme": "^3.9.0",
"enzyme-adapter-react-16": "^1.12.1",
"lerna": "^3.15.0",
"prettier": "^1.15.3",
"tslint": "^5.12.0",
"tslint-config-prettier": "^1.17.0",
"tslint-eslint-rules": "^5.4.0",
"tslint-loader": "^3.5.4",
"tslint-plugin-prettier": "^2.0.1",
"tslint-react": "^3.6.0",
"typescript": "3.6.4",
"typescript-plugin-styled-components": "^1.0.0"
},
"resolutions": {
"@types/react": "16.8.19"
},
}
React / typcript / yarn.