This repository has been archived by the owner. It is now read-only.

npm "isntall" #2933

Closed
kumarharsh opened this Issue Nov 7, 2012 · 33 comments

Comments

Projects
None yet
@kumarharsh
Copy link

kumarharsh commented Nov 7, 2012

What is the significance of "isntall" command in npm?
Looking into the code, in the file lib/npm.js, aliases{ } has isntall mapped to install

I fathom this is done to go round the common typo users do while typing install.
But, why are we even offering programmers an opportunity to be sloppy and MAKE that mistake? This is counter-intutive IMO

@lacivert

This comment has been minimized.

Copy link

lacivert commented Nov 17, 2012

I agree. And just like now I did, it become like a question for many people: 'what is isntall?' and they will waste their time to understand this.

@isaacs

This comment has been minimized.

Copy link
Member

isaacs commented Nov 29, 2012

Working as designed.

The only way to stumble across this is to be reading the code, and if yo'ure reading the code, then you can see what it is.

npm is designed to do the right thing, even if you sometimes don't.

@isaacs isaacs closed this Nov 29, 2012

@kumarharsh

This comment has been minimized.

Copy link

kumarharsh commented Dec 4, 2012

actually, i was not reading the code initially.

I stumbled across this when node listed all the available commands. and there it was, isntall. I thought maybe it was somehow (in a weird way) different than install, but no... its an alias.

@muloka

This comment has been minimized.

Copy link

muloka commented Jan 14, 2013

If this is a valid alias then doing

npm help isntall

should bring up the help section for install? and/or be listed as an alias on the help page?

@edef1c

This comment has been minimized.

Copy link
Member

edef1c commented Jan 14, 2013

It's a useful typo correction. a non-issue.

@kumarharsh

This comment has been minimized.

Copy link

kumarharsh commented Jan 14, 2013

ok. I get the point of using isntall, although I still feel it makes the programmers more sloppy :)

@scottcc

This comment has been minimized.

Copy link

scottcc commented Mar 20, 2013

+1 muloka, at least to take advantage of the opportunity to opine on whether something isn't as tall as was thought.

@sam-github

This comment has been minimized.

Copy link

sam-github commented May 14, 2013

@issacs, not just visible in source, shows up in the usage message, where it looks like a bug:
% npm help | grep isntall
home, i, info, init, install, isntall, issues, la, link,
Of course, google finds this issue, where its explained as a feature.

@yetzt

This comment has been minimized.

Copy link

yetzt commented Jul 16, 2013

<3 for this feautre.

@kumarharsh

This comment has been minimized.

Copy link

kumarharsh commented Jul 20, 2013

after actually using npm for quite a long time now, I've noticed that i've rarely mistyped the 'install' command...

but of course, there are much larger things to discuss and do in this world than nitpicking on this typo. If @isaacs wants to keep this "feature", its cool. There is no harm in it except some bytes of extra code :P

Double Closing this issue.

@luk-

This comment has been minimized.

Copy link
Contributor

luk- commented Jul 20, 2013

isntall is definitely not coming out ever.

On Saturday, July 20, 2013, Kumar Harsh wrote:

after actually using npm for quite a long time now, I've noticed that i've
rarely mistyped the 'install' command...

but of course, there are much larger things to discuss and do in this
world than nitpicking on this typo. If @isaacs https://github.com/isaacswants to keep this "feature", its cool. There is no harm in it except some
bytes of extra code :P

Double Closing this issue.


Reply to this email directly or view it on GitHubhttps://github.com/isaacs/npm/issues/2933#issuecomment-21295428
.

@sferik

This comment has been minimized.

Copy link

sferik commented Aug 21, 2013

We should be solving the general problem: people sometimes make typos, instead of the specific problem: people sometimes type “isntall” when they mean “install”. I’m sure there are other npm commands that are frequently mistyped. We ought to calculate the Levenshtein distance between unrecognized commands and known commands and select the best match, within some reasonable threshold. Modern versions of git do precisely this.

> git lgo
WARNING: You called a Git command named 'lgo', which does not exist.
Continuing under the assumption that you meant 'log'
in 0.1 seconds automatically...

PS: There is a nice package for calculating Levenshtein distance.

PPS: Can you pass the salt?

@kumarharsh

This comment has been minimized.

Copy link

kumarharsh commented Aug 22, 2013

@sferik : A very good idea

@bobthecow

This comment has been minimized.

Copy link

bobthecow commented Aug 22, 2013

@sferik Oh, they do it automatically now? That's about a jillion times awesomer than what my version of git does:

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

Did you mean this?
    log

Yes. For the love. What kind of a pedantic jerk knows what I meant but points it out to me instead of just doing it?

@sferik

This comment has been minimized.

Copy link

sferik commented Aug 22, 2013

Actually, it’s not automatic…but you can enable it by adding the following to your global .gitconfig:

[help]
    autocorrect = 1

The value appears to be tenths-of-a-second to wait before continuing with the best guess (e.g. autocorrect = 10 waits 1 second). Setting it to 0 disables autocorrect.

@bobthecow

This comment has been minimized.

Copy link

bobthecow commented Aug 23, 2013

Awesome. Thanks Erik!

@rjmunro

This comment has been minimized.

Copy link

rjmunro commented Sep 12, 2013

@bobthecow:

What kind of a pedantic jerk knows what I meant but points it out to me instead of just doing it?

It's always possible that it wasn't what you meant and it guessed wrong. The result of it doing the wrong thing automatically might be very bad.

@bobthecow

This comment has been minimized.

Copy link

bobthecow commented Sep 12, 2013

@rjmunro In git, not very often. The reflog's got your back :)

@stefanbeller

This comment has been minimized.

Copy link

stefanbeller commented Jan 19, 2014

@memeyou

This comment has been minimized.

Copy link

memeyou commented Feb 25, 2014

scared the crud out of me when it didn't give an error and started installing stuff.

@rkulla

This comment has been minimized.

Copy link

rkulla commented Mar 10, 2014

I never seem to typo that word, but thought you guys did. Confused me. Seems better to just let the user do their own auto-correction for words they tend to type wrong, because it will show up in pastes in tutorials and debugging output, not help the person learn to correct their bad habits, could potentially mess with future auto-completion, etc.

Not a huge deal, just my two sense.

@adrianheine

This comment has been minimized.

Copy link

adrianheine commented May 7, 2014

I don't care very much about whether npm recognizes that typo or not. However, I find it very confusing that it is listed in the npm command list but has no documentation. I actually read it as »isn’t all« and had no clue what it did until I read this issue.

@cesarvarela

This comment has been minimized.

Copy link

cesarvarela commented May 30, 2014

+1 to sferik suggestion.

I don't get why someone could be against this, I think this practice should be implemented everywhere. And it's not sloppy, it's helpful. The smarter the software the less I work.

KenanY referenced this issue Jun 12, 2014

alias for install
Because @SlexAxton is too nice a guy to actually troll him.
@neimad-zz

This comment has been minimized.

Copy link

neimad-zz commented Aug 21, 2014

"isntall" should be removed because it wastes developer time - when a dev sees "isntall" for the first time it seems odd, so they have to do a google search and eventually end up on this page, which is ridiculous, and wastes 5 minutes of my time.

Just remove it. No sane code/scripts should be using "isntall" anywhere and if they do, shame on everyone involved in that decision. If it's saving you time you're doing it wrong in the first place.

@erg

This comment has been minimized.

Copy link

erg commented Aug 21, 2014

+1 on isntall wasting my time. wtf people.

@othiym23

This comment has been minimized.

Copy link
Contributor

othiym23 commented Aug 22, 2014

You people have no poetry in your souls.

@ktalik

This comment has been minimized.

Copy link

ktalik commented Aug 28, 2014

You people have no correctness in your minds. J/K (also surprised with isntall)

@zeke

This comment has been minimized.

Copy link
Contributor

zeke commented Aug 28, 2014

I've been delighted by isntall more than a few times.

@michaelnisi

This comment has been minimized.

Copy link
Contributor

michaelnisi commented Aug 28, 2014

but isn't all what you install
winter or fall, spring and summer too
just bar foo

@ktalik

This comment has been minimized.

Copy link

ktalik commented Aug 28, 2014

Please provide --poetic option for npm.

@Jon889

This comment has been minimized.

Copy link

Jon889 commented Sep 25, 2014

Typing isntall in a script and not bothering to change it is lazy and bad, but accidentally typing it in the prompt isn't bad because typing is speed is much more of an issue. But documenting it in the list of nom commands probably isn't too good of an idea. Also it could be made better by printing "Assuming you meant install not isntall".

@annejhetson

This comment has been minimized.

Copy link

annejhetson commented Oct 20, 2014

10/10 good waste of time would do again

@isaacs

This comment has been minimized.

Copy link
Member

isaacs commented Oct 20, 2014

To reiterate the official position on this: working as designed. npm is not here to punish people for spelling mistakes. npm is here to install your packages, even if you type "isntall".

Reduction-to-absurdity insults and complaints on this or any other npm issue will not be tolerated, and any further behavior of that nature will be regarded as trolling and reported to GitHub administration.

@npm npm locked and limited conversation to collaborators Oct 20, 2014

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.