question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Disable opencollective in CI environments

See original GitHub issue

Type of Issue

[x] Bug Report
[ ] Feature Request

Description

When installing / building a project with ng-packagr as a dependency in a CircleCI environment, the npm install part fails due to the following error:

> ng-packagr@4.4.5 postinstall /home/circleci/repo/node_modules/ng-packagr
> opencollective postinstall

sh: 1: opencollective: Permission denied
wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! ng-packagr@4.4.5 postinstall: `opencollective postinstall`
npm ERR! Exit status 126
npm ERR! 
npm ERR! Failed at the ng-packagr@4.4.5 postinstall script.

See e.g. https://circleci.com/gh/bithost-gmbh/ngx-mat-select-search/114?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

I opened the following issue on opencollective: https://github.com/opencollective/opencollective-postinstall/issues/15

Workaround

An easy workaround is to add the following to the .circleci/config.yml

jobs:
  build:
    ... 
    steps:
      ...
      - run: DISABLE_OPENCOLLECTIVE=true
      - run: npm install

See e.g. https://circleci.com/gh/bithost-gmbh/ngx-mat-select-search/115?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

Suggested fix

Until https://github.com/opencollective/opencollective-postinstall/issues/15 is fixed, it should be detected whether the installation is running in a CircleCI environment and skip the opencollective postinstall script in https://github.com/ng-packagr/ng-packagr/blob/master/package.json#L136

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
macjohnnycommented, Feb 7, 2019

cmd: set DISABLE_OPENCOLLECTIVE = "true"

powershell: $env:DISABLE_OPENCOLLECTIVE = "true"

check it with command printenv

1reaction
macjohnnycommented, Feb 7, 2019

@mal90 you need to install tsickle. Please run:

npm install tsickle

There should furthermore be more information in the log. Please post the entire log

Read more comments on GitHub >

github_iconTop Results From Across the Web

@nuxt/opencollective NPM | npm.io
OPENCOLLECTIVE_FORCE. Strictly Disabled when one the following environment variables is set: OC_POSTINSTALL_TEST; OPENCOLLECTIVE_HIDE; CI ...
Read more >
javascript - How do I block advertising in npm? - Stack Overflow
You can remove ads using the funding package by adding an environment variable: OPEN_SOURCE_CONTRIBUTOR=true.
Read more >
opencollective-postinstall - npm package - Snyk
In some places (e.g. CI) you may want to disable this output. You can do this by setting the environment variable DISABLE_OPENCOLLECTIVE=true ....
Read more >
Pack logicmoo_workspace -- node_modules/opencollective ...
In some places (e.g. CI) you may want to disable this output. You can do this by setting the environment variable DISABLE_OPENCOLLECTIVE=true ....
Read more >
pnpm install
In a CI environment, installation fails if a lockfile is present but ... If you want to disable this behavior, set the recursive-install...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found