无法编译打字稿

时间:2017-04-15 20:09:13

标签: typescript npm leiningen

我想使用lein-typescript插件来编译打字稿文件。 我将typescript个文件放入src文件夹

enter image description here

我向project.clj添加了所需的依赖项并运行了lein deps

(defproject tree-model-system "0.1.0-SNAPSHOT"

  :plugins [[lein-cprop "1.0.1"]
            [lein-cljsbuild "1.1.5"]
            [lein-immutant "2.1.0"]
            [lein-typescript "0.1.3"]
            [lein-npm "0.6.2"]]

  :typescript {:sources ["src/ts"]
               :out-dir "target"
               :module :amd
               :declaration true
               :source-map true
               :remove-comments true
               :preserve-const-enums true
               :supress-implicit-any-index-errors true
               :target :es6
               :debug true}

  :npm {:dependencies[[systemjs "0.19.40"]
                      [core-js "^2.4.1"]
                      [rxjs "5.0.1"]
                      [zone.js "^0.8.4"]
                      [angular-in-memory-web-api "~0.3.0"]
                      ["@angular/common" "~4.0.0"]
                      ["@angular/compiler" "~4.0.0"]
                      ["@angular/core" "~4.0.0"]
                      ["@angular/forms" "~4.0.0"]
                      ["@angular/http" "~4.0.0"]
                      ["@angular/platform-browser" "~4.0.0"]
                      ["@angular/platform-browser-dynamic" "~4.0.0"]
                      ["@angular/router" "~4.0.0"]]
        :devDependencies[[concurrently "^3.2.0"]
                         [lite-server "^2.2.2"]
                         [typescript "~2.1.0"]
                         [canonical-path "0.0.2"]
                         [tslint "^3.15.1"]
                         [lodash "^4.16.4"]
                         [karma "^1.3.0"]
                         [karma-chrome-launcher "^2.0.0"]
                         [karma-cli "^1.0.1"]
                         [karma-jasmine "^1.0.2"]
                         [karma-jasmine-html-reporter "^0.2.2"]
                         [protractor "~4.0.14"]
                         [rimraf "^2.5.4"]
                         ["@types/node" "^6.0.46"]
                         ["@types/jasmine" "2.5.36"]]}

它创建了node_modules文件夹,并在那里安装了所需的依赖项,包括typescript

enter image description here

但是当我尝试运行lein ts时,我得到了

"node_modules\typescript\bin\tsc" is not recognized as an internal or external command, operable program or batch file

有什么问题?

0 个答案:

没有答案