NPM install/update:获取最新版本而无需更改 package.json 和 Git 存储库
NPM install/update: Getting the latest version without having to alter package.json with Git repository
我的 package.json 中的依赖项如下所示:
"dependencies": {
"shared-styleguide": "git+https://oauth2:key@my.company.at/project/shared-styleguide#master",
"handlebars": "github:wycats/handlebars.js",
"underscore": "^1.9.2"
}
"shared styleguide" 包不断变化。每当我执行 npm i
或 npm update
时,共享样式指南包都不会更新。我必须删除 #master
并执行 npm 更新(没有任何反应),然后我必须在最后添加 #master
并再次执行 npm update
以最终获得最新版本。这也是部署工作流程的一个问题,因为有时会使用缓存的旧版本样式指南库。
如何将其写入我的 package.json 以始终获得最新版本的主控?
找到了一个可接受的 - 仍然不是很好的解决方法:在 package.json.
中指定提交哈希
"dependencies": {
"shared-styleguide": "git+https://oauth2:key@my.company.at/project/shared-styleguide#bf6947b3a4c4334072c6dd96bd61b0893d1cb69c",
"handlebars": "github:wycats/handlebars.js",
"underscore": "^1.9.2"
}
更多信息:
What are commit-ish and tree-ish in Git?
npm install from Git in a specific version
仍然欢迎更好的解决方案。
我的 package.json 中的依赖项如下所示:
"dependencies": {
"shared-styleguide": "git+https://oauth2:key@my.company.at/project/shared-styleguide#master",
"handlebars": "github:wycats/handlebars.js",
"underscore": "^1.9.2"
}
"shared styleguide" 包不断变化。每当我执行 npm i
或 npm update
时,共享样式指南包都不会更新。我必须删除 #master
并执行 npm 更新(没有任何反应),然后我必须在最后添加 #master
并再次执行 npm update
以最终获得最新版本。这也是部署工作流程的一个问题,因为有时会使用缓存的旧版本样式指南库。
如何将其写入我的 package.json 以始终获得最新版本的主控?
找到了一个可接受的 - 仍然不是很好的解决方法:在 package.json.
中指定提交哈希"dependencies": {
"shared-styleguide": "git+https://oauth2:key@my.company.at/project/shared-styleguide#bf6947b3a4c4334072c6dd96bd61b0893d1cb69c",
"handlebars": "github:wycats/handlebars.js",
"underscore": "^1.9.2"
}
更多信息:
What are commit-ish and tree-ish in Git?
npm install from Git in a specific version
仍然欢迎更好的解决方案。