我的 JS 项目使用一个名为commitizen
:
https ://github.com/commitizen/cz-cli 的 NPM 包
commitizen
被添加到我devDependencies
的 package.json 文件中。
commitizen
在内部使用一个名为的包opencollective
,如您在此处看到的:https ://github.com/commitizen/cz-cli/blob/master/package.json
commitizen
在 postinstall 钩子上调用opencollective postinstall
它应该运行opencollective
包二进制文件。
在本地我运行 postinstall 钩子没有问题,但是,当我在我的 Jenkins CI 盒子上构建我的项目时,当它运行commitizen
包的 postinstall 钩子时出现此错误
sh: 1: opencollective: not found
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! commitizen@2.10.1 postinstall: `opencollective postinstall`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the commitizen@2.10.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
我试图将node_modules/opencollective/dist/bin
dir 添加到 PATH 但没有运气,我认为是因为opencollective
别名是在opencollective
package.json中定义的
关于如何在不安装全局opencollective
包的情况下运行 opencollective 命令的任何想法?
谢谢!