设为首页 加入收藏

TOP

安装Node和NPM
2017-10-11 15:02:24 】 浏览:9804
Tags:安装 Node NPM

 

1.node和NPM是什么?

 

Node.js® is a java script runtime built on Chrome's V8 java script 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.

 

Node是基于V8的js runtime.

Node.js的特点:

  • 事件驱动
  • 非阻塞IO

Node.js的包管理工具:NPM(node package manager),类比python,ruby的包管理工具。

 

2.安装

2.1 Mac OSX 上安装

使用brew来安装就可以了

brew install node

2.2 Winows上安装node

参考:http://www.tuicool.com/articles/UJNb2eJ

http://imweb.io/topic/57289aa78a0819f17b7d9d5e?utm_source=tuicool&utm_medium=referral

image

 

NPM的一些设置

使用npm list 来查看npm的一些设置,可以看到对某个设置项,有set,get,edit,delete方法。

image

 

或者是直接编辑用户主目录下的 .npmrc 文件:

c:/users/XX/.npmrc

image

 

修改源为淘宝的镜像源:

http://cnodejs.org/topic/4f9904f9407edba21468f31e

1.通过config命令

npm config set registry https://registry.npm.taobao.org 
npm info underscore (如果上面配置正确这个命令会有字符串response)

2.命令行指定

npm --registry https://registry.npm.taobao.org info underscore 

3.编辑 ~/.npmrc 加入下面内容

registry = https://registry.npm.taobao.org

搜索镜像: https://npm.taobao.org

建立或使用镜像,参考: https://github.com/cnpm/cnpmjs.org

下面是在mac的上NPM设置项列表

image

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Mac 配置php开发环境 下一篇VMware10虚拟机安装mac os x 10.9

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目