Skip to content

prepare script missing run-s #714

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

Open
rotu opened this issue Mar 24, 2025 · 4 comments
Open

prepare script missing run-s #714

rotu opened this issue Mar 24, 2025 · 4 comments
Labels

Comments

@rotu
Copy link
Contributor

rotu commented Mar 24, 2025

Describe the bug

Installing globally from the github repo fails.

Reproducing

$ docker run -t --rm alpine ash -c "cd ~ && apk add npm git && npm install --global github:zeromq/zeromq.js"
...
npm error npm error code 127
npm error npm error path /root/.npm/_cacache/tmp/git-cloneebMIGo
npm error npm error command failed
npm error npm error command sh -c run-s build.js
npm error npm error sh: run-s: not found

It seems like the dependency npm-run-all2 is not getting its bin links installed before the prepare script runs.

Expected behavior

I expect installation to succeed.

Tested on

  • OS: MacOS
  • ZeroMQ.js version: N/A
@rotu rotu added the bug label Mar 24, 2025
@rotu
Copy link
Contributor Author

rotu commented Mar 24, 2025

I think this is a bug in npm, specifically npm/cli#6080

@aminya
Copy link
Member

aminya commented Mar 24, 2025

You don't need to build zeromq from the source to use it. Just install the production dependencies.

If you want to build from the source anyway, here's a docker file example:
https://github.com/zeromq/zeromq.js/blob/master/docker/alpine.dockerfile

You can add a runtime stage that copies over the prebuilds, lib, and installs the production dependencies.

Regardless, the npm failure is surprising and a p0 issue in my opinion. Try with pnpm if you can.

@rotu
Copy link
Contributor Author

rotu commented Mar 25, 2025

You don't need to build zeromq from the source to use it. Just install the production dependencies.

I know. The reason I was installing from source is because I wanted to see what it would take to get just the binaries I needed and for hacking on this project. The above script is obviously missing some platform dependencies anyway.

Confirmed that installing with pnpm does not experience this bug. But pnpm install also does not tolerate --build-from-source as a commandline argument.

Ironically, the obvious workaround is broken; even with the --ignore-scripts flag, it runs the prepare script and crashes.

@aminya
Copy link
Member

aminya commented Mar 29, 2025

Dev support via npm isn't supported anyway. I can specify pnpm as a package manager so it works with corepack.

Btw, you can pass build-from-source in .npmrc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants