使用 npm 安装开发版本

using npm to install a development version

alasql 存在一个小问题,开发人员建议暂时使用 v0.3.6-develop-1476 而不是 v0.3.6,这个问题很快就会得到解决。

我对 npm 知之甚少,除了如何安装、删除和列出。使用“--only=dev”似乎没有用,即使在删除和安装之后也是如此:

npm   remove  alasql;
npm  i   --only=dev   alasql;   // this did not install develop-1476

我的问题:如何安装开发人员版本 #1476?这里是0.3.6-develop-1476github信息。

有什么方法可以使用 git clone 而不是 npm 吗?或者将两者结合起来?

非常感谢,很抱歉问了这么基础的问题。

commit history,我们现在知道将版本提升到 0.3.6-develop-1476 的提交的 commit-SHA 是 f19e17eeb908638ef320539e5b80357bfcc0709d 。所以,您需要做的就是:

npm install 'https://github.com/agershun/alasql#f19e17eeb908638ef320539e5b80357bfcc0709d' --verbose 

npm 开始,您只能指向一个版本,单个 git 提交或标记名称。

Synopsis (from npm install documentation)

npm install (with no args, in package dir)
npm install [<@scope>/]<name>
npm install [<@scope>/]<name>@<tag>
npm install [<@scope>/]<name>@<version>
npm install [<@scope>/]<name>@<version range>
npm install <tarball file>
npm install <tarball url>
npm install <folder>

你的情况:

# to install "develop" branch name
npm install agershun/alasql#develop 

# to install specific commit version
npm install agershun/alasql#f19e17eeb908638ef320539e5b80357bfcc0709d 

如果你想让它持久化,记得使用--save