Json Webclipse加载typescript文件时出错
我已经使用sudo npm install-g typescript安装了typescript,它似乎可以工作,因为tsc-version返回版本2.2.2。我还尝试按此建议在本地安装它。我相信我已经正确安装了所有其他文件,因为IDE可以正确打开其他文件 我的操作系统是Ubuntu 16.0 错误消息:Json Webclipse加载typescript文件时出错,json,node.js,typescript2.0,Json,Node.js,Typescript2.0,我已经使用sudo npm install-g typescript安装了typescript,它似乎可以工作,因为tsc-version返回版本2.2.2。我还尝试按此建议在本地安装它。我相信我已经正确安装了所有其他文件,因为IDE可以正确打开其他文件 我的操作系统是Ubuntu 16.0 错误消息: java.lang.IllegalStateException: Node.js could not be found. If it is installed to a location no
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如下所示。我认为typeroot的值应该指向@types位置。实际上,在.json文件所在的同一个目录中,有一个node_modules/@types目录,我认为它应该启用typescript
{
"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中哪个节点返回的路径