Nodejs

NPM常用命令

2016-12-21  本文已影响79人  草原上的一头狼
  1. npm init : 创建一个package.json文件,包括名称、版本、作者等信息;
  2. npm install <name> : 安装nodejs的依赖包;
  3. npm install <name> -g : 将包安装到全局环境中;
  4. npm install <name> --save : 安装的同时,将包的信息写入package.json中;
  5. npm remove <name> : 移除包;
  6. npm update <name> : 更新包;
  7. npm ls : 查看当前安装的所有包;
  8. npm root : 查看当前包的安装路径;
  9. npm root -g : 查看全局安装包的路径;
  10. npm help <topic> : 在默认浏览器中打开指定命令的文档页面,如果topic为空,则列出npm的所有命令;
>npm help
Usage: npm <command>
where <command> is one of:
    add-user, adduser, apihelp, author, bin, bugs, c, cache,
    completion, config, ddp, dedupe, deprecate, docs, edit,
    explore, faq, find, find-dupes, get, help, help-search,
    home, i, info, init, install, isntall, issues, la, link,
    list, ll, ln, login, ls, outdated, owner, pack, prefix,
    prune, publish, r, rb, rebuild, remove, repo, restart, rm,
    root, run-script, s, se, search, set, show, shrinkwrap,
    star, stars, start, stop, submodule, tag, test, tst, un,
    uninstall, unlink, unpublish, unstar, up, update, version,
    view, whoami
npm <cmd> -h     quick help on <cmd>
npm -l           display full usage info
npm faq          commonly asked questions
npm help <term>  search for help on <term>
npm help npm     involved overview
上一篇 下一篇

猜你喜欢

热点阅读