NodeJS环境搭建

1. 安装NodeJS

        安装最新版, 下载地址: http://nodejs.cn/download/

2.  安装NPM

$ npm install npm -g
$ npm -v
$ npm config set prefix "D:\nodejs\node_global"
$ npm config set cache "D:\nodejs\node_cache"

3. 添加系统环境变量

$ NODE_PATH = "D:\nodejs\node_global"

4. 安装CNPM国内镜像

$ npm install -g cnpm --registry=https://registry.npm.taobao.org
$ cnpm -v

5. 添加Path环境变量

# cnpm安装在此目录,要使用必须指定Path路径
系统设置-高级设置: 在path变量下,添加 D:\nodejs\node_global 

6. 安装Yarn

$ cnpm install -g yarn
$ yarn config set registry https://registry.npm.taobao.org

7. 常用命令

$ yarn/npm/cnpm install
$ yarn/npm/cnpm run start 

Ref.

鸣谢!

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。