错误 TS2300:node_modules/@types/core-js/index.d.ts 中重复标识符“PropertyKey”

2024-03-19

我在 Visual Studio Code IDE 的 node_modules/@types/core-js/index.d.ts 中遇到以下错误:

当我跑步时npm start为了服务该应用程序,我得到:

    node_modules/@types/core-js/index.d.ts(21,14): error TS2300: Duplicate identifier 'PropertyKey'.
node_modules/@types/core-js/index.d.ts(85,5): error TS2687: All declarations of 'name' must have identical modifiers.
node_modules/@types/core-js/index.d.ts(145,5): error TS2403: Subsequent variable declarations must have the same type.  Variable '[Symbol.unscopables]' must be of type '{ copyWithin: boolean; entries: boolean; fill: boolean; find: boolean; findIndex: boolean; keys: ...', but here has type 'any'.
node_modules/@types/core-js/index.d.ts(262,5): error TS2687: All declarations of 'flags' must have identical modifiers.
node_modules/@types/core-js/index.d.ts(276,5): error TS2687: All declarations of 'EPSILON' must have identical modifiers.
node_modules/@types/core-js/index.d.ts(311,5): error TS2687: All declarations of 'MAX_SAFE_INTEGER' must have identical modifiers.
node_modules/@types/core-js/index.d.ts(318,5): error TS2687: All declarations of 'MIN_SAFE_INTEGER' must have identical modifiers.
node_modules/@types/core-js/index.d.ts(457,5): error TS2403: Subsequent variable declarations must have the same type.  Variable '[Symbol.toStringTag]' must be of type '"Symbol"', but here has type 'string'.
node_modules/@types/core-js/index.d.ts(457,5): error TS2687: All declarations of '[Symbol.toStringTag]' must have identical modifiers.
node_modules/@types/core-js/index.d.ts(464,5): error TS2687: All declarations of 'prototype' must have identical modifiers.
node_modules/@types/core-js/index.d.ts(492,5): error TS2687: All declarations of 'hasInstance' must have identical modifiers.
node_modules/@types/core-js/index.d.ts(498,5): error TS2687: All declarations of 'isConcatSpreadable' must have identical modifiers.
node_modules/@types/core-js/index.d.ts(504,5): error TS2687: All declarations of 'iterator' must have identical modifiers.
node_modules/@types/core-js/index.d.ts(510,5): error TS2687: All declarations of 'match' must have identical modifiers.
node_modules/@types/core-js/index.d.ts(516,5): error TS2687: All declarations of 'replace' must have identical modifiers.
node_modules/@types/core-js/index.d.ts(522,5): error TS2687: All declarations of 'search' must have identical modifiers.
node_modules/@types/core-js/index.d.ts(528,5): error TS2687: All declarations of 'species' must have identical modifiers.
node_modules/@types/core-js/index.d.ts(534,5): error TS2687: All declarations of 'split' must have identical modifiers.
node_modules/@types/core-js/index.d.ts(540,5): error TS2687: All declarations of 'toPrimitive' must have identical modifiers.
node_modules/@types/core-js/index.d.ts(546,5): error TS2687: All declarations of 'toStringTag' must have identical modifiers.
node_modules/@types/core-js/index.d.ts(552,5): error TS2687: All declarations of 'unscopables' must have identical modifiers.
node_modules/@types/core-js/index.d.ts(609,5): error TS2403: Subsequent variable declarations must have the same type.  Variable '[Symbol.toStringTag]' must be of type '"Math"', but here has type 'string'.
node_modules/@types/core-js/index.d.ts(609,5): error TS2687: All declarations of '[Symbol.toStringTag]' must have identical modifiers.
node_modules/@types/core-js/index.d.ts(613,5): error TS2403: Subsequent variable declarations must have the same type.  Variable '[Symbol.toStringTag]' must be of type '"JSON"', but here has type 'string'.
node_modules/@types/core-js/index.d.ts(613,5): error TS2687: All declarations of '[Symbol.toStringTag]' must have identical modifiers.
node_modules/@types/core-js/index.d.ts(628,5): error TS2687: All declarations of 'size' must have identical modifiers.
node_modules/@types/core-js/index.d.ts(634,5): error TS2687: All declarations of 'prototype' must have identical modifiers.
node_modules/@types/core-js/index.d.ts(645,5): error TS2687: All declarations of 'size' must have identical modifiers.
node_modules/@types/core-js/index.d.ts(651,5): error TS2687: All declarations of 'prototype' must have identical modifiers.
node_modules/@types/core-js/index.d.ts(666,5): error TS2687: All declarations of 'prototype' must have identical modifiers.
node_modules/@types/core-js/index.d.ts(680,5): error TS2687: All declarations of 'prototype' must have identical modifiers.
node_modules/@types/core-js/index.d.ts(692,5): error TS2687: All declarations of 'value' must have identical modifiers.
node_modules/@types/core-js/index.d.ts(804,5): error TS2687: All declarations of 'prototype' must have identical modifiers.
node_modules/typescript/lib/lib.es2015.core.d.ts(17,14): error TS2300: Duplicate identifier 'PropertyKey'.

这是我的 tsconfig.json:

    {
  "compilerOptions": {
    "target": "es5",
    "module": "system",
    "moduleResolution": "node",
    "lib": ["es2015", "dom"],
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": true,
    "outDir":"js/app/",
    "typeRoots": [
      "./node_modules/@types"
    ]
  },
    "exclude": [
    "node_modules",
    "app/test"
  ]
}

我的包.json

    {
  "name": "vepo",
  "version": "1.0.0",
  "scripts": {
    "coverage": "istanbul cover ./test.js",
    "lite-server-test": "lite-server --config=liteserver-test-config.json",
    "test": "karma start karma.config.js",
    "start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" \"sass --watch app\" \"sass --watch index.scss\" \"sass --watch global-constants.scss\" ",
    "lite": "lite-server",
    "tsc": "tsc",
    "tsc:w": "tsc -w"
  },
  "bin":{
    "e2e-test-start": "bin/e2e-test-start.js" 
},
  "license": "ISC",
  "moduleResolution": "node",
  "dependencies": {
    "@angular/common": "~2.2.0",
    "@angular/compiler": "~2.2.0",
    "@angular/core": "~2.2.0",
    "@angular/forms": "~2.2.0",
    "@angular/http": "~2.2.0",
    "@angular/platform-browser": "~2.2.0",
    "@angular/platform-browser-dynamic": "~2.2.0",
    "@angular/router": "~3.2.0",
    "@angular/upgrade": "~2.2.0",
    "@types/bootstrap": "^3.3.32",
    "@types/core-js": "^0.9.34",
    "@types/google-maps": "^3.1.28",
    "@types/jasmine": "^2.5.38",
    "@types/jquery": "^2.0.34",
    "@types/node": "^6.0.51",
    "angular-in-memory-web-api": "~0.1.15",
    "angular2-google-maps": "^0.15.0",
    "angular2-modal": "^2.0.0",
    "bootstrap": "^3.3.7",
    "core-js": "^2.4.1",
    "jquery": "v3.1.1",
    "jshint": "^2.9.4",
    "ng2-bs3-modal": "^0.10.4",
    "ng2-popover": "0.0.9",
    "protractor": "4.0.11",
    "reflect-metadata": "^0.1.8",
    "rxjs": "5.0.0-beta.12",
    "systemjs": "0.19.39",
    "tslint": "^4.0.2",
    "zone.js": "^0.6.25"
  },
  "devDependencies": {
    "@types/google-maps": "^3.1.28",
    "angular-mocks": "^1.5.8",
    "codelyzer": "1.0.0-beta.0",
    "concurrently": "^3.0.0",
    "core-js": "^2.4.1",
    "del": "latest",
    "gulp": "^3.9.1",
    "gulp-changed": "^1.3.2",
    "gulp-concat": "^2.6.1",
    "gulp-imagemin": "^3.1.1",
    "gulp-jshint": "^2.0.4",
    "gulp-minify-html": "^1.0.6",
    "gulp-sass": "latest",
    "gulp-sourcemaps": "latest",
    "gulp-strip-debug": "^1.1.0",
    "gulp-tslint": "latest",
    "gulp-typescript": "latest",
    "gulp-uglify": "^2.0.0",
    "istanbul": "^0.4.5",
    "jasmine": "~2.4.1",
    "karma": "latest",
    "karma-chrome-launcher": "latest",
    "karma-cli": "^1.0.1",
    "karma-coverage": "latest",
    "karma-htmlfile-reporter": "^0.3.4",
    "karma-jasmine": "latest",
    "karma-jasmine-html-reporter": "^0.2.2",
    "karma-mocha-reporter": "latest",
    "karma-phantomjs2-launcher": "latest",
    "karma-story-reporter": "latest",
    "lite-server": "latest",
    "path": "latest",
    "phantomjs2": "latest",
    "protractor-jasmine2-html-reporter": "0.0.6",
    "require-dir": "latest",
    "systemjs-builder": "latest",
    "tslint": "latest",
    "typescript": "latest"
  }
}

我该如何解决这个问题?

**编辑:我曾经使用过typings for .d.ts文件,但我继续@types。我还更新了我的 npm 和 node 以尝试解决此问题:

{ app: '1.0.0',
  npm: '3.10.8',
  ares: '1.10.1-DEV',
  http_parser: '2.7.0',
  icu: '57.1',
  modules: '48',
  node: '5.something',
  openssl: '1.0.2j',
  uv: '1.9.1',
  v8: '5.1.281.84',
  zlib: '1.2.8' }

to this:

{ app: '1.0.0',
  npm: '4.0.2',
  ares: '1.10.1-DEV',
  http_parser: '2.7.0',
  icu: '57.1',
  modules: '48',
  node: '6.9.1',
  openssl: '1.0.2j',
  uv: '1.9.1',
  v8: '5.1.281.84',
  zlib: '1.2.8' }

npm-debug.log:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]
2 info using [email protected] /cdn-cgi/l/email-protection
3 info using [email protected] /cdn-cgi/l/email-protection
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected] /cdn-cgi/l/email-protection~prestart: [email protected] /cdn-cgi/l/email-protection
6 silly lifecycle [email protected] /cdn-cgi/l/email-protection~prestart: no script for prestart, continuing
7 info lifecycle [email protected] /cdn-cgi/l/email-protection~start: [email protected] /cdn-cgi/l/email-protection
8 verbose lifecycle [email protected] /cdn-cgi/l/email-protection~start: unsafe-perm in lifecycle true
9 verbose lifecycle [email protected] /cdn-cgi/l/email-protection~start: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/Ben/Development/vepo/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
10 verbose lifecycle [email protected] /cdn-cgi/l/email-protection~start: CWD: /Users/Ben/Development/vepo
11 silly lifecycle [email protected] /cdn-cgi/l/email-protection~start: Args: [ '-c',
11 silly lifecycle   'tsc && concurrently "npm run tsc:w" "npm run lite" "sass --watch app" "sass --watch index.scss" "sass --watch global-constants.scss" ' ]
12 silly lifecycle [email protected] /cdn-cgi/l/email-protection~start: Returned: code: 2  signal: null
13 info lifecycle [email protected] /cdn-cgi/l/email-protection~start: Failed to exec start script
14 verbose stack Error: [email protected] /cdn-cgi/l/email-protection start: `tsc && concurrently "npm run tsc:w" "npm run lite" "sass --watch app" "sass --watch index.scss" "sass --watch global-constants.scss" `
14 verbose stack Exit status 2
14 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:279:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:191:7)
14 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:191:7)
14 verbose stack     at maybeClose (internal/child_process.js:877:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid [email protected] /cdn-cgi/l/email-protection
16 verbose cwd /Users/Ben/Development/vepo
17 error Darwin 16.1.0
18 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
19 error node v6.9.1
20 error npm  v4.0.2
21 error code ELIFECYCLE
22 error [email protected] /cdn-cgi/l/email-protection start: `tsc && concurrently "npm run tsc:w" "npm run lite" "sass --watch app" "sass --watch index.scss" "sass --watch global-constants.scss" `
22 error Exit status 2
23 error Failed at the [email protected] /cdn-cgi/l/email-protection start script 'tsc && concurrently "npm run tsc:w" "npm run lite" "sass --watch app" "sass --watch index.scss" "sass --watch global-constants.scss" '.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the vepo package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     tsc && concurrently "npm run tsc:w" "npm run lite" "sass --watch app" "sass --watch index.scss" "sass --watch global-constants.scss"
23 error You can get information on how to open an issue for this project with:
23 error     npm bugs vepo
23 error Or if that isn't available, you can get their info via:
23 error     npm owner ls vepo
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

升级中"@types/core-js": "0.9.34"到版本0.9.39 https://www.npmjs.com/package/@types/core-js为我工作。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

错误 TS2300:node_modules/@types/core-js/index.d.ts 中重复标识符“PropertyKey” 的相关文章

随机推荐

  • as.POSIXct 拒绝 +1300 时区

    我在用着as POSIXct用时区解析时间 如下所示 as POSIXct 2009 01 05 14 19 1200 format Y m d H M z 但是 如果字符串包含时区信息 1300 函数返回NA gt as POSIXct
  • SQLGrammarException:ORA-00904(“无效标识符”)

    我收到 Oracle 错误 org hibernate exception SQLGrammarException当我对使用 JPA 和 Spring 的 Java 类运行 JUnit 测试时 ORA 00904 ALIAS COLUMN
  • Wix 自定义对话框

    目前 我们的安装向导使用的是 Wix 经典主题 现在 我们计划改进安装程序的外观和感觉 1 我如何将自定义对话框经典主题更改为其他主题 2 在安装我们的设置时 我们计划显示一些图像 例如幻灯片放映 是否可以像 Wix 中那样显示图像 我是否
  • 镜像两个可写 SVN 存储库之间的子文件夹

    我正在尝试处理涉及我公司的 SVN 服务器的情况 我们将所有重要代码保存在锁定服务器中 我们将其称为 开发 服务器 有些文件需要由公司网络外部的用户编辑 因此我们有另一个 SVN 服务器 全局 服务器 它可以在防火墙外部访问 并且包含那些包
  • Opencv 静态构建,jpeg,png,tiff 不是静态链接?

    我将 opencv 233 构建为静态库 但是当我在应用程序中使用它时 在调用 cv imwrite 时会出现链接错误 tiff png jasp 库未链接 这是我应该在我的应用程序中链接这些我自己的意图还是我错误地构建了它 我希望第 3
  • C# 泛型:“X where T: X”泛型类型约束有什么意义?

    读一本书 NHibernate 3 初学者指南 https www packtpub com application development nhibernate 3 beginners guide我发现了一个令我好奇的片段 实践时刻 创建
  • 使用 Qt,工作线程创建新的 GUI 元素

    我将保持代码简单 以便你们可以看到我正在尝试做什么 我知道所有锁定问题等 我试图弄清楚信号和插槽如何与线程一起使用 在main cpp中 int main int argc char argv QApplication app argc a
  • 欧拉计划 #13 理解 (Python)

    问题13 http projecteuler net problem 13 http projecteuler net problem 13 计算出以下一百个 50 位数字之和的前十位数字 那么 问题的总和是 5000 位 答案是结果的前
  • Hibernate:@SecondaryTable 不起作用

    I know SecondaryTable这些问题已经发布了很多次 所以 如果有相同的问题 我还没有找到 请给我链接或建议 我的数据库中有两个表 firstTable and secondTable 两个 POJO Hibernate 类
  • 选择物化多选中的所有选项

    Bootstrap 多重选择有选择全部的选项 例如这里 https stackoverflow com questions 26525739 boostrap multiselect select all checked by defaul
  • 如何在 C 中连接两个字符串宏?

    我正在尝试为我的程序实现 VERSION 宏 该宏将在某些情况下进行更改 宏 VERSION 通过 Makefile 定义 git 信息放在那里 并且是一个字符串 现在我有一组 define d 开关 我希望 VERSION 能够反映其中哪
  • 如何在 Ruby 中创建简单的数组?

    在 Ruby 中创建这个数组的最短方法是什么 10 20 30 40 50 60 70 80 90 100 谢谢你的帮助 关于什么Range step http www ruby doc org core 2 0 Range html me
  • 在.Net 下为低完整性进程添加写访问权限

    我正在创建一个用于文件创建的 FileSecurity 该文件对于低完整性进程也应该具有写入访问权限 FileSecurity fileAcl new FileSecurity add everyone IdentityReference
  • 在 Symfony2 中配置 Assetic 的输出目录

    我想全局配置 assetic 转储 JS 文件的输出目录 目前 他们总是去web js 我想将其更改为web js compiled 可以在每个文件级别指定它 http symfony com doc 2 0 cookbook asseti
  • [:space:] 和 [:blank:] 有什么区别?

    来自正则表达式简介 http tldp org LDP abs html x17046 html blank 匹配空格或制表符 space 匹配空白字符 空格和水平制表符 对我来说 这两个定义是相同的 我想知道它们是否真的重复 如果不同 有
  • 嵌套文档上的 Azure DocumentDB ARRAY_CONTAINS

    似乎是ARRAY CONTAINS嵌套文档上的函数永远不会匹配任何文档 例如 尝试使用 Azure DocumentDB 进行以下简单查询查询游乐场 https www documentdb com sql demo Sandbox SEL
  • 为什么必须同时使用编译器标志和运行时标志才能在 Haskell 中获得多核支持?

    Haskell wiki 显示您需要同时设置编译标志和运行时标志才能获得多核支持 为什么使用该库不足以在编译时获得正确的行为 为什么运行时可执行文件无法检测到它是使用 threaded 编译的并使用系统上的所有内核 除非另有指定 我认为默认
  • 在 Unix 上正确处理 PID 文件的参考

    我在哪里可以找到备受推崇的参考详细介绍了 Unix 上 PID 文件的正确处理 在 Unix 操作系统上 通常的做法是使用特殊的锁定文件 PID 文件来 锁定 程序 通常是守护程序 这是一个位于可预测位置的文件 通常是 var run fo
  • 如何在 Windows 上使用 subprocess.run 运行 bash 命令 [重复]

    这个问题在这里已经有答案了 我想使用运行 shell 脚本和 git bash 命令subprocess run 在 python 3 7 4 中 当我在上面运行这个简单的例子时子流程文档页面 https docs python org 3
  • 错误 TS2300:node_modules/@types/core-js/index.d.ts 中重复标识符“PropertyKey”

    我在 Visual Studio Code IDE 的 node modules types core js index d ts 中遇到以下错误 当我跑步时npm start为了服务该应用程序 我得到 node modules types