Install specific branch from github using Npm

后端 未结 8 1692
自闭症患者
自闭症患者 2020-11-29 18:57

I would like to install bootstrap-loader from github in my project using npm

Currently they are maintaining two version of this project which are comaptible with web

8条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-29 19:41

    Just do:

    npm install username/repo#branchName --save
    

    e.g. (my username is betimer)

    npm i betimer/rtc-attach#master --save
    
    // this will appear in your package.json:
    "rtc-attach": "github:betimer/rtc-attach#master"
    

    One thing I also want to mention: it's not a good idea to check in the package.json for the build server auto pull the change. Instead, put the npm i (first command) into the build command, and let server just install and replace the package.

    One more note, if the package.json private is set to true, may impact sometimes.

提交回复
热议问题