Skip to content

Commit 1c732b3

Browse files
authored
Update postinstall so that it doesn't cause failures
There are a few known scenarios where the opencollective postinstall npm script can cause things to break further down the pipeline - a few being 'certain build/CI environments', 'script permission issues' and 'offline installs'.... Arguably, displaying a banner soliciting funding shouldn't disrupt the development or build processes of projects leveraging libraries that are optionally, and non-functionally, using opencollective. Ultimately, at the heart of the failure, is a non 0 exit code being returned in the cases that opencollective fails to properly execute. To prevent this non-zero exit code failure so that subsequent npm processes aren't disrupted as a result of non-functional dependency issues, a "|| exit 0" should be added to the postinstall npm script. There are many discussions about this issue and workaround - here are a few: opencollective/opencollective-cli#5 nuxt/nuxt#1357 opencollective/opencollective-cli#3 opencollective/opencollective-postinstall#2 compodoc/compodoc@99ea09f orizens/ngx-infinite-scroll#321 WebReflection/document-register-element#165
1 parent aa47a38 commit 1c732b3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"test:update": "jest -u",
1717
"test:ci": "jest --runInBand",
1818
"test:watch": "jest --watch",
19-
"postinstall": "opencollective-postinstall",
19+
"postinstall": "opencollective-postinstall || exit 0",
2020
"lint": "eslint src",
2121
"prettify": "prettier --single-quote --trailing-comma=es5 --write './**/*.md'",
2222
"clean-install": "rm -rf node_modules && yarn"

0 commit comments

Comments
 (0)