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] failure in workspace run-script as part of prepack shows unhelpful error #5766

Closed
2 tasks done
lukekarrys opened this issue Oct 27, 2022 · 0 comments
Closed
2 tasks done
Assignees
Labels
Bug thing that needs fixing Priority 1 high priority issue Release 9.x work is associated with a specific npm 9 release

Comments

@lukekarrys
Copy link
Member

lukekarrys commented Oct 27, 2022

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

With npm@9.0.1:

❯ npm pkg get 
{
  "name": "prepack-error",
  "version": "1.0.0",
  "main": "index.js",
  "scripts": {
    "prepack": "npm run build -w workspace"
  },
  "workspaces": [
    "workspace"
  ]
}

❯ npm pkg get -w workspace
{
  "workspace": {
    "name": "workspace",
    "version": "1.0.0",
    "main": "index.js",
    "scripts": {
      "build": "exit 1"
    }
  }
}

❯ npm pack                
npm ERR! code 1
npm ERR! path /Users/lukekarrys/Desktop/garbage/prepack-error
npm ERR! er.stdout.trim is not a function

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/lukekarrys/.npm/_logs/2022-10-27T19_42_22_339Z-debug-0.log

Expected Behavior

It should show the message from npm run build -w workspace instead of an internal npm error.

@lukekarrys lukekarrys added Bug thing that needs fixing Release 9.x work is associated with a specific npm 9 release Priority 1 high priority issue labels Oct 27, 2022
@lukekarrys lukekarrys self-assigned this Oct 27, 2022
lukekarrys added a commit that referenced this issue Nov 2, 2022
These libraries now return strings by default which is what we always
want in the CLI for error reporting.

Fixes #5766
lukekarrys added a commit that referenced this issue Nov 2, 2022
These libraries now return strings by default which is what we always
want in the CLI for error reporting.

Fixes #5766
nlf pushed a commit that referenced this issue Nov 2, 2022
These libraries now return strings by default which is what we always
want in the CLI for error reporting.

Fixes #5766
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Priority 1 high priority issue Release 9.x work is associated with a specific npm 9 release
Projects
None yet
Development

No branches or pull requests

2 participants
@lukekarrys and others