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

[BUG] signalManager.add called with undefined in Docker container #13

Closed
billyjanitsch opened this issue Oct 28, 2020 · 1 comment
Closed

Comments

@billyjanitsch
Copy link

What / Why

This code assumes that add is only ever called with an object with a once method:

const add = proc => {
runningProcs.add(proc)
if (!handlersInstalled)
setupListeners()
proc.once('exit', ({ code }) => {

In fact, add is called with undefined in a Docker container when running any script. (I'm not sure what about the Docker environment causes this.) See repro instructions below.

When

Repros consistently.

Where

  • n/a

How

  • n/a

Current Behavior

When running any script, npm raises the following error:

23 verbose stack TypeError: Cannot read property 'once' of undefined
23 verbose stack     at Object.add (/usr/local/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/signal-manager.js:36:8)
23 verbose stack     at runScriptPkg (/usr/local/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/run-script-pkg.js:63:19)
23 verbose stack     at runScript (/usr/local/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/run-script.js:8:16)
23 verbose stack     at runScript (/usr/local/lib/node_modules/npm/lib/run-script.js:77:11)

Steps to Reproduce

Create a Dockerfile containing:

FROM node:14.14

RUN npm install --global npm@7.0.6

WORKDIR /app

RUN npm init -y
RUN npm test || exit 0
RUN cat /root/.npm/_logs/*.log

Then, run docker build ..

Expected Behavior

An error should not be raised.

Who

References

  • n/a
@billyjanitsch
Copy link
Author

Closed by npm/promise-spawn#5.

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 a pull request may close this issue.

1 participant