输入任何命令后使用npm命令

时间:2014-12-16 14:18:13

标签: node.js npm

我在win8.1中使用cmder。我用npm安装了node.js.我在cmder中为npm创建了别名,当我试图检查它是否正常时,我使用npm --version我得到的是

npm config 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, v,
    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\svrcek\.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config

npm@1.4.3 C:\Program Files\nodejs\node_modules\npm

有人可以帮我解决问题吗?我发现所有这些都是在插入无效命令时显示的,但我认为它是有效的

1 个答案:

答案 0 :(得分:1)

你应该尝试这个别名:

alias npm=C:\Progra~2\nodejs\npm.cmd $*如果您有&#34; Program Files(x86)&#34;要么 alias npm=C:\Progra~1\nodejs\npm.cmd $*如果您只是&#34; Program Files&#34;。

相关问题