Start Node. js development in Ubuntu

Source: Internet
Author: User
Node. js learning has been put down for almost two months, and the world has changed so fast that many things have changed and express has been upgraded to 4. x, the change is not small! My original learning process was to install Ubuntu.12.04amd64 in VirtualBox. I tried my best to change it to Ubuntu14.04amd64. I found that I couldn't install it. I thought about it. Should I upgrade VirtualBox! Upgrade VirtaulBox to the latest 4.3.12r93733

Node. js learning has been put down for almost two months, and the world has changed so fast that many things have changed and express has been upgraded to 4. x, the change is not small!

My original learning process was to install Ubuntu.12.04 amd64 in VirtualBox. I tried my best to replace it with Ubuntu 14.04 amd64. I found that it could not be installed. I thought about whether VirtualBox should be upgraded! Upgrade VirtaulBox to the latest 4.3.12 r93733!

The environment establishment process and related problems are recorded as follows:

1. Create a virtual directory and map the directories under win7 to Ubuntu, because the software is downloaded under win7! Run mount-t vboxsf UbtShare/mnt/UbtShare

2. Install node. I downloaded the Binary Package, decompress it directly to the main directory, change it to node, and then create a soft link: ln-s/home/linuxidc/node/bin/node/usr/bin/node; create a soft link for npm: ln-s/home/linuxidc/node/bin/npm/usr/bin/npm.

This is a small problem. Although npm can be executed, its corresponding configuration file has not yet been created. In this case, an error occurs when you use the npm config edit command. solution, you can use the following command to generate a configuration file while modifying the Mirror Server Source: npm config set registry http://registry.cnpmjs.org, which can be verified by the command npm info underscore.

3. I use the webstorm Editor, which uses java and therefore requires jdk installation. Two months ago, I used webstorm 7 and only needed to modify it ~ /. Profile. Now I am using webstorm 8, and I keep reminding me that I cannot find jdk! Depressed, constantly google. After Continuous testing, we found that we need to modify/etc/environment as follows:

PATH = "... :/Usr/lib/jvm/jdk1.7.0 _ 60/bin "CLASSPATH =.:/usr/lib/jvm/jdk1.7.0 _ 60/lib

JAVA_HOME =/usr/lib/jvm/jdk1.7.0 _ 60

4. install express: Because express 4.x has separated the command line tool, you only need to install this tool globally: npm install-g express-generator

You can use express-e blog to create a project. The-e parameter refers to the use of the ejs engine! Several npm commands: npm-d install (installation package check) npm udate (update, which can be used to fix the installation package) npm start (Project startup, no longer node app)

5. When webstorm is used, experiment is continuously performed on ubuntu and win7_64. The webstorm under ubuntu will contain Chinese garbled characters in the menu. The solution is as follows: File-> settings-> UI Options under appearance, check Override default fonts... I chose Wen Quan Yi Micro Hei. This problem occurs because the default font does not support Chinese characters.

6. For the ejs template I use, this is required for reference to javascript files:

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.