我试图在 Docker 容器中自动化 npm publish
,但是当 npm login
命令尝试读取用户名和电子邮件时,我收到一个错误:
npm login << EOF
username
password
email
EOF
它在 Bash 终端中工作,但在容器中(没有 stdin
)显示错误:
Username: Password: npm ERR! cb() never called!
npm ERR! not ok code 0
根据 Npm-adduser:
用户名、密码和电子邮件从提示中读取。
不使用 stdin
如何运行 npm login
?