打字稿错误:重复标识符“LibraryManagedAttributes" [英] TypeScript error: Duplicate identifier 'LibraryManagedAttributes'

查看:45
本文介绍了打字稿错误:重复标识符“LibraryManagedAttributes"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编译失败.

/moonholdings.io/node_modules/@types/react-dom/node_modules/@types/react/index.d.ts(2312,14):重复标识符LibraryManagedAttributes".

/moonholdings.io/node_modules/@types/react-dom/node_modules/@types/react/index.d.ts (2312,14): Duplicate identifier 'LibraryManagedAttributes'.

不知道为什么我会得到这个.

Not sure why I'm getting this.

我已经将我的 "@types/node" 从 10 降级到 8 并且这不起作用.也试过"@types/node":"^9.6.7"

I've downgraded my "@types/node" from 10 to 8 and that didn't work. Also tried "@types/node": "^9.6.7"

我的仓库:https://github.com/Futuratum/moonholdings.io

我的 package.json

My package.json

{
  "name": "moonholdings.io",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "build-css": "node-sass-chokidar src/ -o src/ --source-map",
    "watch-css": "npm run build-css && node-sass-chokidar src/ -o src/ --watch --recursive --source-map",
    "start": "react-scripts-ts start",
    "build": "react-scripts-ts build",
    "test": "react-scripts-ts test --env=jsdom",
    "eject": "react-scripts-ts eject"
  },
  "dependencies": {
    "@types/react": "^16.4.14",
    "@types/react-redux": "^6.0.9",
    "node-sass-chokidar": "^1.3.3",
    "react": "^16.5.0",
    "react-dom": "^16.5.0",
    "react-redux": "^5.0.7",
    "react-router-dom": "^4.3.1",
    "react-scripts-ts": "2.17.0",
    "redux-thunk": "^2.3.0"
  },
  "devDependencies": {
    "@types/jest": "^23.3.2",
    "@types/node": "^8.10.29",
    "@types/react-dom": "^16.0.7",
    "typescript": "^3.0.3"
  }
}

这是我的 tsconfig

Here is my tsconfig

    {
  "compilerOptions": {
    "traceResolution": false,
    "strictNullChecks": true,
    "noImplicitAny": true,
    "module": "esnext",
    "target": "es5",
    "lib": [
      "es2015",
      "es2017",
      "es6",
      "es7",
      "es5",
      "dom"
    ],
    "jsx": "react",
    "experimentalDecorators": true,
    "moduleResolution": "node",
    "baseUrl": "./src",
    "noUnusedLocals": true,
    "noUnusedParameters": false,
    "noImplicitAny": false,
    "allowSyntheticDefaultImports": true,
    "importHelpers": true,
    "strictFunctionTypes": false
  },
  "include": [
    "src/**/*",
    "webpack/**/*"
  ],
  "files": [
    "core.ts",
    "sys.ts",
    "types.ts",
    "tsc.ts",
    "registerServiceWorker.ts",
    "src/registerServiceWorker.ts",
    "src/setupTests.ts"
  ],
  "exclude": [
    "typings/browser.d.ts",
    "typings/browser",
    "typings",
    "node_modules",
    "build",
    "scripts",
    "acceptance-tests",
    "webpack",
    "jest"
  ]
}

推荐答案

我仍然不确定是什么导致了这个错误,但是我已经检查了我的应用程序的早期版本,它是稳定的.所以要从那里继续工作.

I'm still not sure what caused that bug, however I've checked out a much earlier version of my app, where it was stable. So going to continue work from there.

这是工作包.json

{
  "name": "moonholdings.io",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "start": "react-scripts-ts start",
    "build": "react-scripts-ts build",
    "test": "react-scripts-ts test --env=jsdom",
    "eject": "react-scripts-ts eject"
  },
  "dependencies": {
    "@types/jest": "^23.3.1",
    "@types/node": "^10.9.4",
    "@types/react": "^16.4.13",
    "@types/react-dom": "^16.0.7",
    "react": "^16.4.2",
    "react-dom": "^16.4.2",
    "react-ts-with-scss": "2.1.0",
    "typescript": "^3.0.3"
  },
  "devDependencies": {}
}

这篇关于打字稿错误:重复标识符“LibraryManagedAttributes"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆