[英]Intellij IDEA: How to enable TypeScript development for node apps?
I've read as much info as I could, be I still get error TS2304: Cannot find name 'require'.
我已经阅读了尽可能多的信息,因为仍然
error TS2304: Cannot find name 'require'.
What else do I have to do to be able to develop for node.js in IDEA with TypeScript? 为了使用TypeScript在IDEA中为node.js进行开发,我还需要做什么?
What else do I have to do to be able to develop for node.js in IDEA with TypeScript
为了使用TypeScript在IDEA中为node.js开发,我还需要做什么?
The reference you added is only valid to give you type information for JavaScript projects . 您添加的参考仅对您提供JavaScript项目的类型信息有效 。 For TypeScript you need to explicitly have
node.d.ts
in your project and properly /// <reference
ed. 对于TypeScript,您需要在项目中显式包含
node.d.ts
并正确/// <reference
ed。
you can get node.d.ts
from TSD https://github.com/DefinitelyTyped/tsd tsd install node
您可以从TSD https://github.com/DefinitelyTyped/tsd
tsd install node
获取node.d.ts
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.