Skip to content

[BUG] --production installs devDependencies if the devDependency has a shrinkwrap #1113

@marcosloic

Description

@marcosloic

What / Why

If a project has a devDependency that itself has a shrinkwrap, then the devDependency's dependencies will be installed

When

  • n/a

How

npm install --only=prod

Current Behavior

devDependencies get installed

Steps to Reproduce

  • npm init
  • npm install polymer-cli --save-dev
  • rm -rf node_modules
  • npm install --only=prod

Expected Behavior

polymer-cli is a devDependency, as such nothing should be installed

This issue has been spotted because polymer-cli has vulnerable dependencies spotted by retirejs. The --production (or --only=prod) seems to work if the devDependency does not have a shrinkwrap file. npm ci --production works as expected and bypasses the devDependencies entirely

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions