postinstall script fails on CI
On my CI server (Jenkins). postinstall script fails trying to execute:
opencollective postinstall command.
This is the error
sh: 1: opencollective: not found
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: 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! [email protected] postinstall: `opencollective postinstall`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
I've tried to add 'node_modules/opencollective/dist/bin' dir to the PATH but with no luck. Any ideas?
Personally not a fan of the "postinstall": "opencollective ..." script for a number of reasons, mostly because it adds 11.6 MB of things to install just to print a message.
Maybe we could replace it with a simple echo statement? π€
Iβm ok with us removing it completely if it is annoying people.
Jim ForCy
On September 2, 2018 at 4:32:58 PM, Linus UnnebΓ€ck ([email protected]) wrote:
Personally not a fan of the "postinstall": "opencollective ..." script for a number of reasons, mostly because it adds 11.6 MB https://packagephobia.now.sh/result?p=opencollective of things to install just to print a message.
Maybe we could replace it with a simple echo statement? π€
β You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/commitizen/cz-cli/issues/560#issuecomment-417961338, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGpituOqhdXYpbEW3R5zkjTL_Yk0VCNks5uXE6KgaJpZM4WVWkF .
I agree with @LinusU.
Adding a package just for printing a (fancy) message doen't really add much value to the project. I'd π the idea of replacing opencollective package with a print message.
As side note, I've figured out how to solve the initial problem on Jenkins.
Basically, on my CI pipeline commitizen doesn't get installed globally so I have to manually specify the path to the opencollective bin.
This can be achieved adding the following:
:${env.WORKSPACE}/node_modules/.bin
to the PATH configuration in Jenkinsfile file.
Seems like this have been brought up before as well π€ #544
At this point, it might be best to remove it for now?
It's still strange that you have to mess with the PATH though π€ npm should fix that automatically when running scripts...
@LinusU looking at the filesystem, under node_modules/.bin I can find a symlink opencollective -> ../opencollective/dist/bin/opencollective.js.
I suspect that in a "standard npm setup" node_modules/.bin is added to the path by default, on my CI box I believe there are some restrictions due to the fact that a docker container is created/destroyed for each build so I need to explicitely add node_modules/.bin to the path.
It's just a guess as I don't have much control/knowledge over this CI pipeline.
Thanks for removing the post-install hook! This was causing a lot of problems during CI.. if we can get a release with this fix that would be π π