Skip to content

[BUG] npm pack no longer auto-adds npm-shrinkwrap.json to tarball when files is specified #6803

@zackschuster

Description

@zackschuster

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

As of v9, npm pack will no longer add npm-shrinkwrap.json to the generated tarball if you specify files within package.json without including npm-shrinkwrap.json in the specified array. This behavior is present in v10 as well.

Expected Behavior

The generated tarball should automatically include npm-shrinkwrap.json even if it is not included in a specified files array in package.json.

Steps To Reproduce

  1. Create a package with npm init -y
  2. Add a package (e.g. npm i react)
  3. Run npm shrinkwrap
  4. Add a files array to package.json
  5. Run npm pack
  6. The cli output will not list npm-shrinkwrap.json, nor will it be present in the tarball

Environment

  • npm: 9.5.1
  • Node.js: 18.16.1
  • OS Name: macOS 12.6.8
  • System Model Name: MacBook Pro (Retina, 13-inch, Early 2015)
  • npm config:
update-notifier = false 

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next stepsRelease 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