node.js - Using TypeScript type definitions with Webstorm 10 -
this question has answer here:
i trying use webstorm 10's new built-in typescript compiler. when compiling simple node.js file such below, gives ts compilation error of "error:(1, 15) ts2304: cannot find name 'require'.
var express = require('express'); var router = express.router(); var nconf = require('nconf');
i followed "downloading , installing javascript-related library webstorm" section https://www.jetbrains.com/webstorm/help/configuring-javascript-libraries.html. using dialog, downloaded node , express type definitions , can see them in external libraries section of project. however, still same error "require".
how should setting webstorm's typescript built-in compiler work definition files downloaded external libraries. need manually reference them in each .ts file , if so, path of files in "external libraries". also, shouldn't webstorm automatically know definitions visual studio don't have manually reference them? there tsc compiler flag can set in built-in compiler's options aware of definitions?
using dialog, downloaded node , express type definitions , can see them in external libraries section of project. however, still same error "require"
that dialog gets typescript definitions to use javascript. need download typescript definitions manually (using tsd
recommended) , add them project.
Comments
Post a Comment