node.js 基础及安装配置
2018-02-01 本文已影响0人
Seaofdesire
介绍
Node.js 是一个基于 Chrome V8 引擎的 JavaScript 运行环境。
Node.js 使用了一个事件驱动、非阻塞式 I/O 的模型,使其轻量又高效。
Node.js 的包管理器 npm,是全球最大的开源库生态系统。
下载 (尽量下载LTS版本)
安装
- .msi 版本下载双击运行安装(简单)
运行
- cmd进入命令行
node -v

验证自带npm包管理
npm -v

目录结构
-
node 模块 包含npm包管理器
image.png
-
npm 下载依赖包(类似maven)
image.png
配置
- 使用淘宝 cnpm 替换 npm
http://npm.taobao.org/
npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm install [name]
- 恢复
npm config set registry https://registry.npmjs.org/