C:\Program Files\nodejs>npm.cmd
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, 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
Specify configs in the ini-formatted file:
C:\Users\Administrator\.npmrc
or on the command line via: npm <command> –key value
Config info can be viewed via: npm help config
npm@1.2.32 C:\Program Files\nodejs\node_modules\npm
安装插件:
C:\Program Files\nodejs>npm install mysql@2.0.0-alpha8
npm http GET https://registry.npmjs.org/mysql/2.0.0-alpha8
npm http 200 https://registry.npmjs.org/mysql/2.0.0-alpha8
npm http GET https://registry.npmjs.org/mysql/-/mysql-2.0.0-alpha8.tgz
npm http 200 https://registry.npmjs.org/mysql/-/mysql-2.0.0-alpha8.tgz
npm http GET https://registry.npmjs.org/require-all/0.0.3
npm http GET https://registry.npmjs.org/bignumber.js/1.0.1
npm http 200 https://registry.npmjs.org/bignumber.js/1.0.1
npm http 200 https://registry.npmjs.org/require-all/0.0.3
npm http GET https://registry.npmjs.org/require-all/-/require-all-0.0.3.tgz
npm http GET https://registry.npmjs.org/bignumber.js/-/bignumber.js-1.0.1.tgz
npm http 200 https://registry.npmjs.org/require-all/-/require-all-0.0.3.tgz
npm http 200 https://registry.npmjs.org/bignumber.js/-/bignumber.js-1.0.1.tgz
npm WARN package.json github-url-from-git@1.1.1 No repository field.
npm WARN package.json assert-plus@0.1.2 No repository field.
npm WARN package.json ctype@0.5.2 No repository field.
mysql@2.0.0-alpha8 node_modules\mysql
├── require-all@0.0.3
└── bignumber.js@1.0.1
C:\Program Files\nodejs>
世界上最简单的示例:
C:\Program Files\nodejs>node.exe hello.js
hello, world
C:\Program Files\nodejs>type hello.js
console.log(“hello, world”);
C:\Program Files\nodejs>