Skip to content

[BUG] install script does not run in workspace in 8.5.4 #4552

@perrin4869

Description

@perrin4869

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

Given the following:

❯ cat package.json
{
  "name": "npm854",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "install": "echo root install",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "workspaces": ["subpackage"]
}
❯ cat subpackage/package.json
{
  "name": "npm854-subpackage",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "install": "touch install",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC"
}

Running npm install will not generate an install file inside the subpackage directory.

Expected Behavior

In 8.5.3 it would run the install script inside the workspaces as well
Probably introduced by #4529

Steps To Reproduce

No response

Environment

  • npm: 8.5.4
  • Node.js: 16.14.0
  • OS Name: slackware64-current
  • npm config:
; "user" config from /home/perrin4869/.npmrc

//npm.pkg.github.com/:_authToken = (protected)
//registry.npmjs.org/:_authToken = (protected)

; node bin location = /usr/bin/node
; cwd = /home/perrin4869/nodejs/npm854
; HOME = /home/perrin4869
; Run `npm config ls -l` to show all defaults.

Metadata

Metadata

Assignees

Labels

Bugthing that needs fixingPriority 1high priority issueRelease 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