我的JS项目使用一个名为commitizen
的NPM软件包:
https://github.com/commitizen/cz-cli
commitizen
被添加到我的devDependencies
的package.json文件中。
commitizen
在内部使用名为opencollective
的软件包,如您在此处看到的:https://github.com/commitizen/cz-cli/blob/master/package.json
commitizen
正在调用opencollective postinstall
,它应该运行opencollective
软件包二进制文件。
在本地运行后安装挂钩没有问题,但是,当我在Jenkins CI盒上构建项目时,当它运行commitizen
软件包的后安装挂钩时,会出现此错误
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中定义的。 / p>
关于如何能够在不全局安装opencollective
软件包的情况下运行opencollective命令的任何想法?
谢谢!