The command for alias local='...' gets run on terminal open
I could not recreate what you have said is happening to you. 

Saying that I would say that: It is really very dangerous to invoke local as your alias

Because the word local is a shell builtin, a reserved word for the default Bash shell to define a local variable in Bash script inside a Bash function. If you do type local from a new terminal window after removing it from your alias or by unalias local and then you would see it says:

local is a shell builtin


That is why, when you changed your alias to local2 from local it worked fine since local2 is not a shell builtin.

However, if you are using Korn Shell (version 93u+), local is not a shell builtin there. But, in most other shells local is a reserved word or shell builtin. So, in short: local should not be stored as an alias

For more information about shell builtin, look at man page: man builtin

Also, as mentioned by Gordon Davidson, there is definitely something calling the local variable and since you have overridden it as an alias for npm, it is running each time you are opening a new session.