Webclipse 错误加载打字稿文件

Webclipse errors loading typescript files

我已经使用 sudo npm install -g typescript 安装了 typescript,这似乎有效,因为 tsc -version returns 版本 2.2.2。我也尝试按照 的建议在本地安装它。我相信我已经正确安装了所有其他内容,因为 IDE 可以正确打开其他文件。

我的 OS 是 Ubuntu 16.0。

错误信息:

java.lang.IllegalStateException: Node.js could not be found.  If it is installed to a location not on the PATH, please specify the location in the TypeScript preferences.

下面是tsconfig.json。我相信 typeRoots 的值应该指向 @types 位置。实际上,在 .json 文件所在的同一目录中,有一个 node_modules/@types 目录,我认为应该启用打字稿。

{
  "compileOnSave": false,
  "compilerOptions": {
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2016",
      "dom"
    ]
  }
}

报错信息中提到的TypeScript首选项在Webclipse首选项中。 只需在 shell.

中输入 which node 返回的路径