“npm isntall”命令存在 [英] "npm isntall" command exists

查看:614
本文介绍了“npm isntall”命令存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当您键入非法 npm 命令时,您将收到一条用户友好的错误消息,指出哪些命令合法使用:

When you type an illegal npm command, you are getting a user-friendly error message stating which commands are legal to use:

$ npm illegal

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

您可能会注意到,除其他外,还有 isntall 命令

As you may notice, among others there is isntall command.

这个命令有什么意义?如果这是为了处理拼写错误而创建的,那么为什么不对 intall insatll 等进行特殊处理?此外, uninstall 没有相应的 unisntall 选项。

What is the point of this command? If this was created to handle typos, then why doesn't it have a special handling for intall, insatll etc? Besides, uninstall doesn't have a corresponding unisntall option.

(使用npm 1.3.22 版本)。

(Using npm 1.3.22 version).

我问的原因是我对如何处理错字感到有些惊讶和困惑。例如, git 比较您输入的命令并建议最近的命令:

The reason I ask is that I'm a bit surprised and confused about how the typo is handled. For example, git compares the command you've entered and suggests the closest commands it has available:

$ git stats
git: 'stats' is not a git command. See 'git --help'.

Did you mean this?
    status

此外, pip Python包管理器内置了类似的功能:

Also, pip Python package manager has a similar functionality built-in:

$ pip isntall
ERROR: unknown command "isntall" - maybe you meant "install"

仅供参考,引擎盖它使用 difflib.get_close_matches() 功能。

推荐答案

我是Github上关联问题的原始提升者,那些是OSS软件贡献的第一天......我认为这只是一个错字,也许拉动请求会解决这个问题。但我很幸运,首先 提出问题(#2933) 了解他们是否正在寻找这方面的贡献......

I was the original "raiser" of the connected issue on Github, and those were the first days of contributing to OSS software... I thought it was just a typo, and maybe a pull request would solve it. But I was blessed with some good sense to first raise an issue (#2933) to find out if they were looking for contribution on that front...

事实证明,它解开了关于这个问题的整个讨论,很高兴看到。

As it turned out, it unravelled a whole discussion around the issue, which was good to see.

存在理由

无论如何,我认为你是否实现了其中一个algos并为npm项目做出贡献,这对于这个很棒的库来说是一个很好的补充...

At any rate, I presume if you do implement one of those algos and contribute to the npm project, it would be a nice addition to this awesome library...

这篇关于“npm isntall”命令存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆