Skip to content

[BUG] the output of the publish and postpublished are mixed up #4861

@pygy

Description

@pygy

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

The upload bar of the publish script keeps being updated while the postpublish scripts are running, resulting in garbled output:

Here's a sample starting with four lines of adequate output then the rest where the progress bar is mixed with the postpublish output:

npm notice total files:   19
npm notice
npm notice Publishing to https://registry.npmjs.org/
(⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠼ : notice Publishing to https://registry.npmjs.org/
> [email protected] postpublish
> node ./scripts/postpublish.js && npm install && gosub test

(node:82564) ExperimentalWarning: Importing JSON modules is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
$ git tag v0.6.13
$ git push --tags

[... snip ...]

found 0 vulnerabilities
(⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠴ : notice Publishing to https://registry.npmjs.org/
> [email protected] test
> gosub build-regexp && ospec

(⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠴ : notice Publishing to https://registry.npmjs.org/
> [email protected] build-regexp
> node scripts/build-regexp.js

––––––⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠴ : notice Publishing to https://registry.npmjs.org/
All 714 assertions passed (old style total: 714)
+ [email protected]
pygy@Albert2 compose-regexp.js %

Expected Behavior

postpublish should start when publish is done.

Steps To Reproduce

Create a package with a postinstall script that prints to stdout, run npm publish.

Environment

  • npm: v8.9.0
  • Node.js: v17.8.0
  • OS Name: MacOS
  • System Model Name: MacBook Air
  • npm config:
; "user" config from /Users/pygy/.npmrc

//registry.npmjs.org/:_authToken = (protected)

; node bin location = /usr/local/bin/node
; node version = v17.8.0
; npm local prefix = /Users/pygy/dev/compose-regexp.js
; npm version = 8.9.0
; cwd = /Users/pygy/dev/compose-regexp.js
; HOME = /Users/pygy
; Run `npm config ls -l` to show all defaults.```

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next stepsRelease 8.xwork is associated with a specific npm 8 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions