【问题标题】:typescript command tsc -p ./ shows error in typings modules打字稿命令 tsc -p ./ 在打字模块中显示错误
【发布时间】:2017-02-26 06:09:15
【问题描述】:

运行 typecipt 命令时出现以下错误:

tsc -p ./

我在 es6-shim 和其他节点包中遇到此错误

以下是我的 package.json

"scripts": {
    "vscode:prepublish": "tsc -p ./",
    "compile": "tsc -watch -p ./",
    "postinstall": "node ./node_modules/vscode/bin/install"
  },
 "devDependencies": {
    "typescript": "^2.0.3",
    "vscode": "^1.0.0"
  },
  "dependencies": {
    "@types/es6-shim": "^0.31.32",
    "@types/node": "^6.0.45",
    "adm-zip": "^0.4.7",
    "fs": "^0.0.2",
    "github": "^2.6.0",
    "ncp": "^2.0.0",
    "node-watch": "0.4.0",
    "open": "^0.0.5",
    "rimraf": "^2.5.4",
    "temp": "^0.8.3"
  }

TSCONFIG.json

{
    "compilerOptions": {
        "module": "commonjs",
        "target": "es6",
        "outDir": "out",
        "lib": [
            "es6"
        ],
        "sourceMap": true,
        "rootDir": "."
    }, 
    "exclude": [
        "node_modules",
        ".vscode-test"
    ]
}

【问题讨论】:

    标签: node.js json typescript es6-shim


    【解决方案1】:

    我刚刚从 package.json 中删除了 "@types/es6-shim": "^0.31.32"

    因为我已经在 tsconfig.json 中针对 es6

    【讨论】:

      猜你喜欢
      • 2018-11-03
      • 1970-01-01
      • 2015-03-23
      • 2018-10-10
      • 2022-08-16
      • 2017-03-11
      • 1970-01-01
      • 1970-01-01
      • 2016-10-25
      相关资源
      最近更新 更多