New Journey: NodeJS-Environment

Source: Internet
Author: User
Tags install node

With ASP. For many years, I remember the idea of "DRY", which was advocated by MVC, for the simplicity and shock of razor. With the maturity of MVC, I felt as if I had gradually stepped into a high-tech cage created by Microsoft. The feeling that MVC is becoming more and more cumbersome seems to have lost the dexterity of the past, sometimes more like a sense of java. In the MVC4 also saw the MS join many non-C # traditional things, such as Owin Bar, I admit that is a good thing but always let a person do not know where to get Hard in C # written out of the feeling. Write a small web to configure a lot of stuff, install long time environment, endure IIS that foodie long start time ...

Today out of curiosity to pick up the node. js, want to see this recent hot stuff what is the great place, did not expect to be attracted to her all of a sudden! There are a few things that tempt me the most:

    • High performance, based on the Google V8 engine development, based on a non-blocking threading model. (A little bit of a try, the page output time compared to IIS, that is the rockets and turtles in the race)
    • Fully modular development, the reuse rate between modules is very high.
    • Simple and third-party resources are extremely rich, and many of the complex features within MVC require only one or two modules to complete, including many modules developed by Ms itself, such as Azure.
    • Based on JavaScript, this means that using weak-type language development can save a lot of type-related operations in C #, and it can be arbitrary to do the IOC to think about how cool it is. And a set of code well written can be run on the server can also be used for the client, then the client and the server has the same or similar business processing logic of the code can not be integrated?
    • The view engine is numerous and can be easily changed to your liking (feeling or jade is the most simple knot)

I installed the node. JS Environment under window, but very often the problem with the dad NPM is that it might be a matter of permissions, in short, there will be errors when installing many common packages with NPM. But running on Ubuntu doesn't have this kind of problem, because you can use sudo to authorize NPM. Share a little bit of experience in building a NODEJS development environment here.

Install node. js

Installing Nodejs in Ubuntu is simple, just type the following command in the command window:

sudo apt-get install python-software-propertiessudo add-apt-repository ppa:chris-lea/node.jssudo Apt -Get updatesudo apt-get install Nodejs NPM

You can use NPM once the installation is successful. Here is the module library for node. JS: https://www.npmjs.org/Want to install what module is here to find it.

A few bags of recommended must-Ann

Other first forget, first installed these several web development is the most useful package. I'll cover them in more detail in the next article

sudo npm install Express--gsudo npm Install body-parser----  -gsudo npm installless-middleware-G

Development environment


I am also a rookie in Ubuntu, for node. JS is small white, so Google a bit to see what everyone is using to develop node. js. Many people recommend the use of sublime as a development tool, due to the long-term use of vs.net personal feeling sublime very bad, although his plug-in very much but with a debug
The environment is a painful thing. Finally, I chose Webstorm, the tool is a Java-developed IDE for node. JS, less support is very good. Webstorm's own JavaScript analysis is much better than vs.net, and can also parse out the class tree of JavaScript files! (VS. NET-to-date functionality). To http://www.jetbrains.com/webstorm/download to the local unpacked package can be used, there is no special installation process, the only feeling of the pit dad is to use the command line to start the webstorm.

sudo sh/[webstorm installation directory]/bin/webstore.sh

Webstorm can create a site template for node Express directly:

Now you're ready to try node. js to do MVC!

In the next article I'll cover more node-related content in one section.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.