npm adduser via bash

前端 未结 9 1393
清歌不尽
清歌不尽 2021-02-01 18:48

I want to automate the npm login process via a bash script.

I tried it with this snippet:

/usr/bin/expect -f - <

        
9条回答
  •  鱼传尺愫
    2021-02-01 19:19

    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

提交回复
热议问题