Skip to content

[BUG] failure in workspace run-script as part of prepack shows unhelpful error #5766

Closed
@lukekarrys

Description

@lukekarrys

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 [email protected]:

❯ 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.

Metadata

Metadata

Assignees

Labels

Bugthing that needs fixingPriority 1high priority issueRelease 9.xwork is associated with a specific npm 9 release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions