简体   繁体   English

目录/node_modules/@antv/g6-core/lib/types/index.d.ts(24,37) 中的 TypeScript 错误:预期类型。 TS1110

[英]TypeScript error in directory/node_modules/@antv/g6-core/lib/types/index.d.ts(24,37): Type expected. TS1110

After cloning the repo from GitHub and installing packages by running yarn install, when I'm run the project getting this error.从 GitHub 克隆 repo 并通过运行 yarn install 安装包后,当我运行项目时出现此错误。 I tried to update react script latest, doesn't work.我试图更新最新的反应脚本,不起作用。 Also, tried to update typescript 4.1.2 doesn't work.此外,尝试更新 typescript 4.1.2 不起作用。

  • Node v: 14.17.3节点 v:14.17.3
  • Npm v: 6.14.13 Npm v: 6.14.13
  • Yarn v: 1.22.10纱线诉:1.22.10

在此处输入图像描述

This is my package.json这是我的 package.json

{
    "name": "zis3-frontend",
    "version": "4.6.41.3",
    "created": "2022-03-15 20:23:03",
    "private": true,
    "dependencies": {
        "@ant-design/charts": "^1.0.8",
        "@ant-design/icons": "^4.1.0",
        "@types/i18next": "^13.0.0",
        "@types/react-highlight-words": "^0.16.1",
        "@types/react-redux": "^7.1.8",
        "@types/react-router": "^5.1.7",
        "@types/react-router-dom": "^5.1.5",
        "antd": "^4.10.2",
        "antd-button-color": "^1.0.3",
        "antd-mask-input": "^0.1.13",
        "array-move": "^4.0.0",
        "axios": "^0.19.2",
        "fast-xml-parser": "^3.20.3",
        "i18next": "17.0.1",
        "i18next-browser-languagedetector": "^4.1.1",
        "i18next-http-backend": "^1.0.8",
        "moment": "^2.25.3",
        "node-sass": "4.14.1",
        "query-string": "^6.13.0",
        "react": "^16.13.1",
        "react-csv": "^2.2.2",
        "react-dom": "^16.13.1",
        "react-highlight-words": "^0.16.0",
        "react-i18next": "10.11.0",
        "react-icons": "^4.1.0",
        "react-json-pretty": "^2.2.0",
        "react-quill": "^1.3.5",
        "react-redux": "^7.2.0",
        "react-router": "^5.1.2",
        "react-router-dom": "^5.1.2",
        "react-scripts": "^3.4.3",
        "react-sortable-hoc": "^2.0.0",
        "redux": "^4.0.5",
        "redux-thunk": "^2.3.0",
        "sweetalert2": "^11.3.0"
    },
    "scripts": {
        "start": "react-scripts start",
        "build": "react-scripts --max_old_space_size=4096 build && REACT_APP_BUILD_VERSION=$(./ci/get_fe_version.py) && sed -i -- 's/%REACT_APP_BUILD_VERSION%/'$REACT_APP_BUILD_VERSION'/g' build/index.html && echo React Build Version = $REACT_APP_BUILD_VERSION",
        "test": "react-scripts test",
        "eject": "react-scripts eject"
    },
    "postcssSortingConfig": {
        "properties-order": "alphabetical"
    },
    "browserslist": {
        "production": [
            ">0.2%",
            "not dead",
            "not op_mini all"
        ],
        "development": [
            "last 1 chrome version",
            "last 1 firefox version",
            "last 1 safari version"
        ]
    },
    "devDependencies": {
        "prettier": "2.0.5",
        "stylelint": "^13.3.3",
        "stylelint-config-sass-guidelines": "^7.0.0",
        "stylelint-config-standard": "^20.0.0",
        "stylelint-statement-max-nesting-depth": "^2.0.1",
        "typescript": "^3.9.7"
    }
}

TS Config TS 配置

{
  "compilerOptions": {
    "target": "es6",
    "module": "esnext",
    "jsx": "react",
    "lib": ["dom", "dom.iterable", "scripthost", "es5", "es6"],
    "baseUrl": "./src",
    "allowJs": true,
    "skipLibCheck": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    "outDir": "./dist",
    "rootDir": "./src",
    "removeComments": true,
    "noEmitOnError": true,
    "noImplicitAny": false,
    "noLib": false,
    "preserveConstEnums": true,
    "declaration": false,
    "suppressImplicitAnyIndexErrors": true,
    "sourceMap": true
  },
  "filesGlob": ["./src/**/*.ts", "./src/**/*.tsx", "!./node_modules/**"],
  "include": ["./src/**/*"],
  "exclude": ["node_modules", "**/*.spec.ts"],
  "rules": {
    "quotemark": "single",
    "autoFixOnSave": true
  }
}

Eg.例如。 I did the following npm uninstall -D typescript (This uninstalled 3.9.7 version) npm i -D typescript@4.2.4我做了以下 npm uninstall -D typescript (这个卸载的 3.9.7 版本) npm i -D typescript@4.2.4

This fixed the problem这解决了问题

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Angular 7 node_modules/graphql-tag/lib/index.d.ts(2,57) 中的错误:错误 TS1005:“,”预期 - Angular 7 ERROR in node_modules/graphql-tag/lib/index.d.ts(2,57): error TS1005: ',' expected node_modules/@types/lodash/common/array.d.ts(37,24) 中的错误:错误 TS1005:';' 预期的 - ERROR in node_modules/@types/lodash/common/array.d.ts(37,24): error TS1005: ';' expected SPFx Webpart - node_modules/@types/ [prop types] 和 [react] index.d.ts:gulp 构建时加载“错误 TS1005” - SPFx Webpart - node_modules/@types/ [prop types] and [react] index.d.ts: loads of "error TS1005" on gulp build 如何修复Angular 2错误的node_modules/@types/systemjs/index.d.ts(333,13)? - How to fix node_modules/@types/systemjs/index.d.ts (333,13) of Angular 2 error? node_modules/@types/node/index.d.ts(20,1):错误 TS1084:无效的“引用”指令语法 - node_modules/@types/node/index.d.ts(20,1): error TS1084: Invalid 'reference' directive syntax tsc错误TS1110 node.d.ts Node.js v6.x - tsc error TS1110 node.d.ts Node.js v6.x ../node_modules/@types/node/assert.d.ts:3:68 中的错误 - 错误 TS1144: '{' or ';' 预期的 - ERROR in ../node_modules/@types/node/assert.d.ts:3:68 - error TS1144: '{' or ';' expected 错误 - [tsc] node_modules/@fluentui/react/lib/components/ContextualMenu/ContextualMenu.types.d.ts(13,35): 错误 TS1005: ';' 预期的 - Error - [tsc] node_modules/@fluentui/react/lib/components/ContextualMenu/ContextualMenu.types.d.ts(13,35): error TS1005: ';' expected 错误 node_modules/jest-diff/build/diffLines.d.ts(8,13):错误 TS1005:'=' 预期。 在嵌套 js 中 - error node_modules/jest-diff/build/diffLines.d.ts(8,13): error TS1005: '=' expected. in nest js node_modules/@fullcalendar/core/main.d.ts(1196,54) 中的错误:错误 TS1144:'{' 或 ';' 预期的 - ERROR in node_modules/@fullcalendar/core/main.d.ts(1196,54): error TS1144: '{' or ';' expected
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM