I want to automate the npm login process via a bash script.
I tried it with this snippet:
/usr/bin/expect -f - <
I had this issue but the only way of getting round it was to wrap expect into a docker image. You can use it like so:
docker run \
-e NPM_USER=$NPM_USER \
-e NPM_PASS=$NPM_PASS \
-e NPM_EMAIL=$NPM_EMAIL \
bravissimolabs/generate-npm-authtoken \
> ~/.npmrc
https://github.com/bravissimolabs/docker-generate-npm-authtoken