[英]installing node.js typescript packages on vs2017
I'm trying to write a node.js server with typescript. 我试图用typescript编写一个node.js服务器。
I found this link which explains how to do it: 我发现此链接说明了如何执行此操作:
http://brianflove.com/2016/03/29/typescript-express-node-js/ http://brianflove.com/2016/03/29/typescript-express-node-js/
They install the typescript versions of "body-parser", "express", etc, but they do it from the console like so: 他们安装了“ body-parser”,“ express”等打字稿版本,但它们是从控制台执行的,如下所示:
node_modules/.bin/typings install body-parser --ambient --save
Is there a way to do it with visual studio 2017? 有没有办法用Visual Studio 2017做到这一点?
I saw that I can add packages with the NPM, but it only adds the js versions of the packages. 我看到我可以使用NPM添加软件包,但它仅添加软件包的js版本。
You can install typescript version of package like this : npm install -S @types/lodash
您可以像这样npm install -S @types/lodash
软件包的打字稿版本: npm install -S @types/lodash
FOund this here : https://www.typescriptlang.org/docs/handbook/migrating-from-javascript.html 在这里找到: https ://www.typescriptlang.org/docs/handbook/migrating-from-javascript.html
I tried it with package like express and it works pretty well. 我尝试过像快递这样的包装,效果很好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.