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

fix(gatsby-telemetry): gracefully handle postinstall script permission errors #19920

Merged
merged 1 commit into from
Dec 3, 2019

Conversation

jamo
Copy link
Contributor

@jamo jamo commented Dec 2, 2019

This really is a hack for a bug in npm, but some other packages,
including core-js does this hack.

To repro:

$ docker run --rm -it ubuntu bash

$ npm install -g gatsby-cli

and it will fail with

> [email protected] postinstall /root/.nvm/versions/node/v10.17.0/lib/node_modules/gatsby-cli/node_modules/gatsby-telemetry
> node src/postinstall.js

sh: 1: node: Permission denied

the || true will just make it exit happily, even though we were unable
to run the postinstall script.

permission errors.

This really is a hack for a bug in npm, but some other packages,
including core-js does this hack.

To repro:
```
$ docker run --rm -it ubuntu bash

$ npm install -g gatsby-cli
```
and it will fail with

```
> [email protected] postinstall /root/.nvm/versions/node/v10.17.0/lib/node_modules/gatsby-cli/node_modules/gatsby-telemetry
> node src/postinstall.js

sh: 1: node: Permission denied
```

the || true will just make it exit happily, even though we were unable
to run the postinstall script.
@jamo jamo requested a review from a team as a code owner December 2, 2019 18:10
Copy link
Contributor

@pvdz pvdz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Such sad

@pieh pieh changed the title Fix npm postinstall error where install fails because node has permission errors. fix(gatsby-telemetry): gracefully handle postinstall script permission errors Dec 3, 2019
@pieh pieh merged commit 8053b4d into master Dec 3, 2019
@delete-merged-branch delete-merged-branch bot deleted the fix-npm-postinstall-again branch December 3, 2019 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants