Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

postinstall script fails on CI #560

Closed
gabrieleantonini opened this issue Aug 31, 2018 · 7 comments · Fixed by #561
Closed

postinstall script fails on CI #560

gabrieleantonini opened this issue Aug 31, 2018 · 7 comments · Fixed by #561
Assignees

Comments

@gabrieleantonini
Copy link

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: 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.

I've tried to add 'node_modules/opencollective/dist/bin' dir to the PATH but with no luck.
Any ideas?

@LinusU
Copy link
Contributor

LinusU commented Sep 2, 2018

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? 🤔

@jimthedev
Copy link
Member

jimthedev commented Sep 2, 2018 via email

@gabrieleantonini
Copy link
Author

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.

@gabrieleantonini
Copy link
Author

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.

@LinusU
Copy link
Contributor

LinusU commented Sep 3, 2018

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...

@gabrieleantonini
Copy link
Author

@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.

@phil-lgr
Copy link

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 👍 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants