Ubuntu 16.04 64-bit Build node.js development environment Tutorial _node.js

Source: Internet
Author: User
Tags mirror website

Objective

First of all, the system environment is: Ubuntu 16.04 64, the content of the test is available, you can rest assured that reference, the following to see the detailed steps.

Use Taobao image

Taobao Mirror website is https://npm.taobao.org/

Please install NPM and node before using the image of Taobao.

Installation of node and NPM

Node can be downloaded here

This article uses the official recommended v4.4.4 long Term support version

Download and extract Node-v4.4.4-linux-x64.tar.xz

 
 

Move to the generic software installation directory/opt/

sudo mv node-v4.4.4-linux-x64/opt/

Install NPM and node commands to system commands

sudo ln-s/opt/node-v4.4.4-linux-x64/bin/node/usr/local/bin/node 
sudo ln-s/opt/node-v4.4.4-linux-x64/bin/npm/ usr/local/bin/npm

Verify:

Node-v

v4.4.4

Npm-v

2.15.1

Set up NPM to use Taobao source

~/.bashrc Add in (please back up first cp ~/.bashrc ~/.bashrc.bak )

Alias cnpm= "NPM--registry=https://registry.npm.taobao.org \
--cache= $HOME/.npm/.cache/cnpm \
--disturl= https://npm.taobao.org/dist \
--userconfig= $HOME/.CNPMRC "

Make the modification take effect immediately, enter, return

SOURCE ~/.BASHRC

Install NPM package with Taobao image

Terminal input

CNPM Install [name]

Appendix A-NPM Command

Global Installation

NPM INSTALL-G Package Name

The path to the global installation can be viewed through the following command

npm config get prefix

The path to the global installation can be modified by the following command

NPM config set prefix "directory"

Local Install (download module to current command line directory), not recommended

NPM Install package Name

Summarize

Above is in Ubuntu 16.04 64 to build node.js development environment All content, hope this article content to everybody's study or work can bring certain help, if have the question everybody can message exchange.

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.