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

[Bug] : cssnano v5 breaks on yarn/npm with --no-bin-links due to postinstall step for opencollective #1046

Closed
proton-ab opened this issue Apr 11, 2021 · 3 comments · Fixed by #1047
Labels

Comments

@proton-ab
Copy link

proton-ab commented Apr 11, 2021

Describe the bug
cssnano v5 added forced dependency on opencollective-postinstall with postinstall which breaks on yarn/npm with --no-bin-links.

To Reproduce

$ yarn --frozen-lockfile --non-interactive --no-bin-links --production
yarn install v1.22.5
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info fsevents@1.2.13: The platform "linux" is incompatible with this module.
info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
[5/5] Building fresh packages...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
error /drone/src/node_modules/cssnano: Command failed.
Exit code: 127
Command: opencollective-postinstall
Arguments: 
Directory: /drone/src/node_modules/cssnano
Output:
/bin/sh: opencollective-postinstall: not found

Expected behavior
No issue during install in all environments supported by cssnano

Additional context
Generally acceptable solution here would be to use node ./node_modules/opencollective-postinstall/index.js.

--no-bin-links is a very useful option on filesystems where creating symlinks is not possible.

In addition note that the build failed on CI here despite the fact that opencollective-postinstall should have check for process.env.CI.

@ludofischer
Copy link
Collaborator

Thanks for the report.
I am afraid your suggestion breaks if someone uses Yarn 2 PnP as there will be no node_modules:

node ./node_modules/opencollective-postinstall/index.js

@alexander-akait what should we do here?
I think the issue is that it cannot find the opencollective-postinstall script. That's why the process fails even if opencollective-postinstall checks for process.env.CI

ludofischer added a commit that referenced this issue Apr 12, 2021
Fix #1046
The opencollective package breaks some CI setups,
so replace it with the funding field, the same way as postcss.
@ludofischer
Copy link
Collaborator

I have opened a pull request to replace opencollective-postinstall (#1047) with the funding field, since I suspect always printing that message annoys people more than anything else, especially if it breaks their CI.

ludofischer added a commit that referenced this issue Apr 12, 2021
Fix #1046
The opencollective package breaks some CI setups,
so replace it with the funding field, the same way as postcss.
@ludofischer ludofischer mentioned this issue Apr 13, 2021
@ludofischer
Copy link
Collaborator

cssnano@5.0.1 is out which does not use opencollective-postinstall any more.

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

Successfully merging a pull request may close this issue.

2 participants