npm adduser via bash

前端 未结 9 1395
清歌不尽
清歌不尽 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:02

    For people working with a private registry (typically for CI purpose), reaching directly the Rest API may be a solution :

    curl -XPUT -H "Content-type: application/json" -d '{ "name": "your_username", "password": "your_password" }' 'http://localhost:4873/-/user/org.couchdb.user:your_username'
    

    This is what npm adduser is doing behind the scene.

提交回复
热议问题