Start Node. js development in Ubuntu

Source: Internet
Author: User

Start Node. js development in Ubuntu

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/bkjia/node/bin/node/usr/bin/node; the npm soft link is also set up: ln-s/home/bkjia/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. the ejs template I use must be written as follows for reference to javascript files: <script src = ""> </script>; cannot be simplified to <script src = ""/>, I am suffering from this problem.

7. webstorm has a problem with the smart prompts of express, so as to solve the problem: File-> settings-> javascript-> Libraries click the download button, select TypeScript community stubs, and find express in the selection. Or go directly to the https://github.com/borisyankov/DefinitelyTyped To Go To The type definition file.

8. all operations on the same page are controlled by angular. For page Jump, you must go to express (res. in redirect) with angular ($ window. location =.

9. angular version differences: 1.0 to 1.2 note that angular has released ngRoute separately. Currently, most of the source code on the internet is based on 1. 0. *. If you are learning with the latest angular, it is often because of this error. It's easy to go to the official website to see how to upgrade.

Well, I will remember so much. If I can remember it, I will try again later.

The following content is more exciting:

Build a Node. js development environment in Ubuntu 14.04

Install and configure the Node. js development environment in javasru 12.04

Getting started with Node. Js [PDF + related Code]

Node. js Development Guide hd pdf Chinese version + source code

Node. js getting started Development Guide

Install and configure Node. js

Compile and install Node. js in Ubuntu

Node. js details: click here
Node. js: click here

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.