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.

postinstall script fails on CI

See original GitHub issue

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?

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
phil-lgrcommented, Sep 22, 2018

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

0reactions
gabrieleantoninicommented, Sep 3, 2018

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] npm ci doesn't run postinstall script #1905 - GitHub
Current Behavior: npm ci doesn't run the postinstall script Expected Behavior: npm ci ... Installation fails with npm v7 lirantal/npq#185.
Read more >
Failed at the core-js postinstall script error - Stack Overflow
This error means that the postinstall script is fork -and- exec 'ing bash , which is not present on Windows. You need to...
Read more >
scripts - npm Docs
To see the output, run with: --foreground-scripts . prepublish (DEPRECATED). Does not run during npm publish , but does run during npm ci...
Read more >
Quirks - elm-tooling-cli - GitHub Pages
But, this has the consequence that npm install --production / npm ci --production will fail. Why? Because the "postinstall" script will still execute, ......
Read more >
NPM preinstall script fails on circleci - Build Environment
In the script, you can check for an environment variable (envar). Within many CI providers including CircleCI, the envar CI will be set...
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