npm的包安装分为本地安装(local)、全局安装(global)两种本地安装:npm install xxx 安装到命令行所在目录的node_module目录。全局安装:npm install xxx -g 安装到 \AppData\Roaming\npm\node_modules目录。