前端开发学习笔记 - 1. Node.JS安装笔记

Node.JS安装笔记

Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. 
Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. 
Node.js' package ecosystem, npm, is the largest ecosystem of open source libraries in the world.

1. 官网下载 .msi 文件

官网地址 https://nodejs.org

图片描述

2. 安装程序

双击node-v6.9.5-x64.msi进行安装。

图片描述

点击下一步

程序安装的一个好的习惯是, 把程序安装到C盘或者D盘的app目录下面。
比如这次,我们把Node.js安装到 c盘app目录下的C:\app\nodejs

图片描述

3. 验证安装版本

打开命令行
node -v
npm -v

4. 配置node.js库路径和缓存路径

启动cmd,输入
npm config set prefix "C:\node_lib\node_global"
以及
npm config set cache "C:\node_lib\node_cache"

查看现在的路径
npm config get prefix
npm config get cache

5. 设置淘宝镜像

npm config set registry http://registry.npm.taobao.org/
修改源地址为官方源
npm config set registry https://registry.npmjs.org/

查看现在的源
npm config get registry

7. 设置环境变量

NODE_PATH
C:\node_lib\node_global\node_modules
PATH
C:\node_lib\node_global\

8. 你可以愉快的使用了

# 全局安装webpack
npm install webpack -g

猜你喜欢

转载自www.cnblogs.com/homehtml/p/11837154.html
今日推荐