I am trying to pass in an input as one line to an user-input prompt, but am having difficulty working out how to do it correctly.
Specifically I am trying to login to npm using npm adduser
(npm login
is its alias)
When it's a singular value it works but this only gets me so far: echo exampleuser| npm adduser
Username: exampleuser
Password:
Password: npm ERR! cb() never called!
But unfortunately when I try to add multiple commands together it goes awry. Eg:
echo 'exampleuser examplepassword ex@email.com'| npm adduser
or
echo 'exampleuser\r\nexamplepassword\r\nex@email.com'| npm adduser
or
echo 'exampleuser&& echo examplepassword&& echo ex@email.com'| npm adduser
, etc...
Gets back errors along the lines of
Username: 'exampleuser examplepassword'
npm WARN Name must be lowercase
Username:
Username: npm ERR! cb() never called!
Any suggestions would be greatly appreciated.