在Jenkins上为npm install PATH安装脚本

时间:2018-08-31 19:34:22

标签: jenkins npm-install commitizen

我的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命令的任何想法?

谢谢!

0 个答案:

没有答案