“npm isntall” command exists

怎甘沉沦 提交于 2019-12-04 23:50:36

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.

The raison d'être of the isntall command is because the npm maintainers believe that it saves them time — and thus, by extension — several other developers. As has been discussed in the linked issue, this was a contentious decision, and several people have suggested more interesting methods for resolving typos such as using the levenshtein distance calculation of the illegal command from valid npm commands (https://www.npmjs.org/package/levenshtein).

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...

Because there's no way to handle every single possible typo, without breaking other stuff. Init could possibly be a typo of install.

Could do levenshtein distance from your input or something but introduces unnecessary complexity.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!