无法从npm脚本编译打字稿

时间:2018-08-14 11:52:32

标签: javascript typescript

{
  "name": "typescript-example",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "compile": "./node_modules/.bin/tsc.cmd --outDir ./build --module commonjs ./src/*.ts",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "typescript": "^3.0.1"
  }
}

项目结构:

-project
    -src
        -main.ts
   -node_modules
        -.bin
            -tsc
            -tsc.cmd
            -tsserver
            -tsserver.cmd
        -typescript
            ...

    -package.json
    -tsconfig.json

命令:npm run compile

错误:error TS6053: File 'src/*.ts' not found.


我不想在全球范围内安装打字稿。

0 个答案:

没有答案