Define private registry in package.json

前端 未结 2 1900
南笙
南笙 2021-02-18 22:26

We have a private npm repository based on Sinopia

What should I define in package.json that some packages will be installed from Synopia rather then from g

2条回答
  •  有刺的猬
    2021-02-18 23:22

    One of the method i know that is by .npmrc You can also use .npmrc also inside the project

    set configuration like this

    registry = http://10.197.142.28:8081/repository/npm-internal/
    init.author.name = Himanshu sharma
    init.author.email = rmail@email.com
    init.author.url = http://blog.example.com
    # an email is required to publish npm packages
    email=youremail@email.com
    always-auth=true
    _auth=YWRtaW46YWRtaW4xMjM=
    

    auth can be generate by username:password echo -n 'admin:admin123' | openssl base64

    output YWRtaW46YWRtaW4xMjM=

提交回复
热议问题