javascript 使用 Visual Studio 2010 开发 nodejs

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9108686/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-26 05:38:05  来源:igfitidea点击:

Develop nodejs with visual studio 2010

javascriptvisual-studio-2010node.jseditor

提问by Soham Dasgupta

Is it possible to develop NodeJS applications with VS2010. I'm talking plain ol' Javascript, not Azure or any fancy stuff like that. I just want to use VS2010 as the Javascript editor as I'm from .NET background and I'm very comfortable with it.

是否可以使用VS2010开发NodeJS应用程序。我说的是普通的 Javascript,而不是 Azure 或任何类似的花哨的东西。我只是想使用 VS2010 作为 Javascript 编辑器,因为我来自 .NET 背景并且我对它非常满意。

If I can, then please tell me how to configure VS2010 to be able to code NodeJS applications.

如果可以,请告诉我如何配置 VS2010 以便能够编写 NodeJS 应用程序。

回答by ethan.luo

Sorry, new users aren't allowed to post images.

抱歉,不允许新用户发布图片。

I can read English,but I can't write in English .So ,just this...囧

我能读英文,但我不会写英文。所以,就这个……囧

http://i.stack.imgur.com/aFyWV.jpghttp://i.stack.imgur.com/aFyWV.jpg

http://i.stack.imgur.com/aFyWV.jpghttp://i.stack.imgur.com/aFyWV.jpg

回答by Rohan Singh

If you just want to use Visual Studio as a text editor, you can do that to edit Node apps. Use File> Open Websiteto open the folder that your Node application is in.

如果您只想将 Visual Studio 用作文本编辑器,您可以这样做来编辑 Node 应用程序。使用File> Open Website打开 Node 应用程序所在的文件夹。

You can then open any *.js file and edit it using Visual Studio's text editor.

然后,您可以打开任何 *.js 文件并使用 Visual Studio 的文本编辑器对其进行编辑。

If you want to try some experimental Intellisense support, check out node-vsdoc. You'll have to add the nd/node-vsdoc.jsfile to your project and then reference it like this:

如果您想尝试一些实验性的 Intellisense 支持,请查看node-vsdoc。您必须将该nd/node-vsdoc.js文件添加到您的项目中,然后像这样引用它:

/// <reference path="node-vsdoc.js" />

Here's an example: https://github.com/kinogam/node-vsdoc/blob/master/nd/vsdoc-test.js

这是一个例子:https: //github.com/kinogam/node-vsdoc/blob/master/nd/vsdoc-test.js

回答by Tracker1

I was using VS for Node development and it was just a very poor experience. That said, simply create an Empty Website project. Which is about as empty as a project can be in VS... personally, I wish VS had support for a "non-compiled" or "script" project, to hold misc files, or outside scripts that aren't the purview of VS. That aside you may want to try out the typescript plugins for VS, as they add a lot of useful intellisense support, for what it's worth.

我使用 VS 进行 Node 开发,这只是一次非常糟糕的体验。也就是说,只需创建一个空网站项目。这与 VS 中的项目一样空...就个人而言,我希望 VS 支持“非编译”或“脚本”项目,以保存杂项文件或不属于其权限的外部脚本对比。除此之外,您可能想尝试VS打字稿插件,因为它们添加了许多有用的智能感知支持,这是值得的。

That said, you may want to give another editor a chance, if you don't need integrated source control you might want to look at WebMatrix2(free) from MS, there's a plugin that makes node-inspector debugging transparent. Personally, I've been using JetBrains WebStorm(not too pricey) and loving it.

也就是说,您可能想给另一个编辑器一个机会,如果您不需要集成的源代码控制,您可能想查看MS 的WebMatrix2(免费),有一个插件可以使节点检查器调试透明。就我个人而言,我一直在使用JetBrains WebStorm(不太贵)并且很喜欢它。

回答by Tracker1

To get vsdoc.js intelisense going in vs 2008 you need a microsoft patch:

要在 vs 2008 中使用 vsdoc.js intelisense,你需要一个微软补丁:

http://blogs.msdn.com/b/webdev/archive/2008/11/07/hotfix-to-enable-vsdoc-js-intellisense-doc-files-is-now-available.aspx

http://blogs.msdn.com/b/webdev/archive/2008/11/07/hotfix-to-enable-vsdoc-js-intellisense-doc-files-is-now-available.aspx

Then follow Rohan's answer to get the rest going

然后按照 Rohan 的回答进行操作

回答by Eran Betzalel

A couple of days ago Microsoft released official tools for Node JS. These tools are huge improvement over the other hacky solutions I've tried to pull off with Visual Studio.

几天前,微软发布了 Node JS 的官方工具。这些工具与我尝试使用 Visual Studio 实现的其他 hacky 解决方案相比有了巨大的改进。

http://techcrunch.com/2013/11/21/microsoft-launches-node-js-tools-for-visual-studio

http://techcrunch.com/2013/11/21/microsoft-launches-node-js-tools-for-visual-studio

I've yet to find a VS 2010 version of these tools. Currently, it only supports VS 2012 and VS 2013.

我还没有找到这些工具的 VS 2010 版本。目前,它只支持 VS 2012 和 VS 2013。

回答by user2491336