首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Tsc与aws崩溃

Tsc与aws崩溃
EN

Stack Overflow用户
提问于 2021-05-15 18:30:52
回答 1查看 111关注 0票数 0

我正在尝试用tsc将ts代码编译成javascript。但它在来自node_modules的亚马逊网络服务代码上不断崩溃。我试图将skipLibCheck添加到我的tsconfig中,将空数组添加到tsconfig的types属性中,并将node_modules路径添加到exclude属性中,但没有帮助。

tsconfig.json

代码语言:javascript
复制
{
  "exclude": ["./node_modules/**"],
  "compilerOptions": {
    "types": [],
    /* Basic Options */
    "incremental": true,
    "target": "es6",
    "module": "commonjs",
    "outDir": "build",
    /* Strict Type-Checking Options */
    "strict": true,
    "noImplicitAny": true,
    "strictNullChecks": true,
    "strictFunctionTypes": true,
    "strictBindCallApply": true,
    "strictPropertyInitialization": true,
    "noImplicitThis": true,
    "alwaysStrict": true,
    /* Additional Checks */
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "noImplicitReturns": true,
    "noFallthroughCasesInSwitch": true,
    /* Module Resolution Options */
    "moduleResolution": "node",
    "baseUrl": ".",
    "esModuleInterop": true,
    "resolveJsonModule": true,
    /* Experimental Options */
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    /* Advanced Options */
    "forceConsistentCasingInFileNames": true,
    "skipLibCheck": true
  },
}

package.json

代码语言:javascript
复制
"dependencies": {
    "@aws-sdk/client-s3": "^3.15.0",
    "bcrypt": "^5.0.1",
    "body-parser": "^1.19.0",
    "cors": "^2.8.5",
    "dotenv": "^9.0.1",
    "express": "^4.17.1",
    "helmet": "^4.6.0",
    "http-status-codes": "^2.1.4",
    "jsonwebtoken": "^8.5.1",
    "multer": "^1.4.2",
    "mysql2": "^2.2.5",
    "reflect-metadata": "^0.1.13",
    "sequelize": "^6.6.2",
    "sequelize-typescript": "^2.1.0",
    "swagger-ui-express": "^4.1.6",
    "tsoa": "^3.6.1"
  },
  "devDependencies": {
    "@tsoa/runtime": "^3.6.1",
    "@types/bcrypt": "^3.0.1",
    "@types/body-parser": "^1.19.0",
    "@types/cors": "^2.8.10",
    "@types/express": "^4.17.11",
    "@types/helmet": "^4.0.0",
    "@types/jsonwebtoken": "^8.5.1",
    "@types/multer": "^1.4.5",
    "@types/node": "^14.14.37",
    "@types/swagger-ui-express": "^4.1.2",
    "@types/validator": "^13.1.3",
    "@typescript-eslint/eslint-plugin": "^4.22.0",
    "@typescript-eslint/parser": "^4.22.0",
    "concurrently": "^6.0.1",
    "eslint": "^7.24.0",
    "eslint-config-prettier": "^8.2.0",
    "eslint-plugin-prettier": "^3.4.0",
    "nodemon": "^2.0.7",
    "prettier": "^2.2.1",
    "sequelize-cli": "^6.2.0",
    "ts-node": "^9.1.1",
    "typescript": "^4.2.4"
  }

样本错误

代码语言:javascript
复制
$ tsc
node_modules/@aws-sdk/client-s3/protocols/Aws_restXml.ts:14525:34 - error TS6133: 'tagName' is declared but its value is never read.

14525         tagValueProcessor: (val, tagName) => (val.trim() === "" ? "" : decodeEscapedXML(val)),
                                       ~~~~~~~


Found 132 errors.
EN

回答 1

Stack Overflow用户

发布于 2021-08-03 22:27:34

如果有人使用这个版本,我的解决方案是将ts升级到v4

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67545726

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档