Created
February 6, 2017 06:08
-
-
Save stableShip/53efdf7cb2eba67108a6f001a557cb8e to your computer and use it in GitHub Desktop.
npm基础命令
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: npm基础命令 | |
date: 2016-08-23 19:07:43 | |
tags: [npm] | |
categories: [npm] | |
--- | |
## 基础命令 | |
**npm install -d** 安装package.json文件中的dependencies, -d显示安装详细信息 | |
**npm init** 初始化package.json文件 | |
**npm outdated** 显示当前项目依赖版本 | |
**npm ls packagename** 显示安装依赖信息, packagename可选, 无则显示当前安装的所有依赖信息 | |
**npm config ls** 显示npm配置信息 | |
## 使用 nrm 管理npm的仓库: | |
npm install nrm -g 安装nrm | |
nrm ls 显示包含仓库 | |
nrm use taobao 使用淘宝的仓库 | |
npm config ls 显示npm配置,可以看到仓库变为淘宝的地址 | |
## 使用 n 管理 node 版本 | |
npm install n -g 安装n | |
n ls 显示当前node版本 | |
n 4.4.7 使用4.4.7版本 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment