postinstall script fails on CI
See original GitHub issueOn 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:
- Created 5 years ago
- Comments:7 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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 👍 🙏
@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 addnode_modules/.bin
to the path. It’s just a guess as I don’t have much control/knowledge over this CI pipeline.