03-01- installation nodejs

Installation nodejs

Introduce a nodejs

Node.js JavaScript is running on the server side.

Node.js is a platform based on a built Chrome JavaScript run-time.

Node.js is an event-driven I / O server-side JavaScript environment, based on Google's V8 engine, the V8 Javascript execution speed is very fast, very good performance.

Why do you want to install Node.js, Grunt tool used below is based on the use of Node.js

Download: https://nodejs.org/en/download/releases/

Select the download version, has been to determine the next step, after the installation into the command line, type:

node -v 
# 显示版本号即安装成功

View the original two mirror address

NPM (node Package Manager) : NodeJS package management for plug-in management node (including installing, uninstalling, management dependence)

npm get registry
# 输出:https://registry.npmjs.org/

Three npm source switching Ali

#切换阿里源
npm config set registry https://registry.npm.taobao.org/
#查看是否成功
npm config get registry
#或者
npm get registry
#可以看到输出
#https://registry.npm.taobao.org/

Four installation cmpm

CNPM : Because npm install the plug-in is downloaded from the server abroad, the affected network is relatively large, an exception may occur, if the server npm like in China, so we are happy to share Taobao team did this thing. From the official website: "This is a complete
npmjs.org image, you can use this instead of the official version (read-only), synchronous frequency of the current 10 minutes to ensure as far as possible be synchronized with the official service."

npm install -g cnpm --registry=https://registry.npm.taobao.org
#查看是否安装成功
cnpm -v
#成功后可以使用cnpm代替npm命令

Five changes in the original environment variables

1, the first storage path arranged npm global module, cache path

npm config set prefix "路径"
npm config set cache "路径"

Guess you like

Origin www.cnblogs.com/dreamlyue/p/12128295.html