我尝试使用npm安装软件包。我想安装最新的master分支,而不是任何版本。在我的package.json中,我目前有:
'packageName': '0.4.x',
有没有办法告诉npm在我运行npm install packageName
而不是其中一个repo的版本时拉出最新的主分支?
我的package.json中的'packageName': 'master'
之类的东西(虽然这不起作用)。
答案 0 :(得分:1)
例如
npm install git+https://github.com/jashkenas/coffee-script.git
或没有git的人
npm install http://github.com/jashkenas/coffee-script/tarball/master
信息来自github
答案 1 :(得分:1)
npm install packageName
only lets you install things that are uploaded to npm.
What I needed to do was to fork the repo myself and create a new release in my own git repo. Then I can use:
npm install git+https://github.com/myGitAccount/my-repo.git
and it will install that latest release.