Is there an existing issue for this?
This issue exists in the latest npm version
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
- Create a package with
npm init -y
- Add a package (e.g.
npm i react)
- Run
npm shrinkwrap
- Add a
files array to package.json
- Run
npm pack
- 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:
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
As of v9,
npm packwill no longer addnpm-shrinkwrap.jsonto the generated tarball if you specifyfileswithinpackage.jsonwithout includingnpm-shrinkwrap.jsonin the specified array. This behavior is present in v10 as well.Expected Behavior
The generated tarball should automatically include
npm-shrinkwrap.jsoneven if it is not included in a specifiedfilesarray inpackage.json.Steps To Reproduce
npm init -ynpm i react)npm shrinkwrapfilesarray topackage.jsonnpm packnpm-shrinkwrap.json, nor will it be present in the tarballEnvironment
update-notifier = false