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:
v4.4.4
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
Install NPM package with Taobao image
Terminal input
Appendix A-NPM Command
Global Installation
NPM INSTALL-G Package Name
The path to the global installation can be viewed through the following command
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
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.