就像NPM的官网( http://npmjs.org/ )上介绍的那样,安装NPM仅仅是一行命令的事情: curl http://npmjs.org/install.sh | sh 这里详解一下这句命令的意思,curl http://npmjs.org/install.sh是通过curl命令获取这个安装shell脚本,按后通过管道符| 将获取的脚本交由sh命令来执行。这里如果没有权限会安装不成功,需要加上sudo来确保权限: curl http://npmjs.org/install.sh | sudo sh 安装成功后执行npm命令,会得到一下的提示: Usage: npm <command> where <command> is one of: adduser, apihelp, author, bin, bugs, c, cache, completion, config, deprecate, docs, edit, explore, faq, find, get, help, help-search, home, i, info, init, install, la, link, list, ll, ln, ls, outdated, owner, pack, prefix, prune, publish, r, rb, rebuild, remove, restart,