Skip to content

[BUG] npm pack not working with chokidar in bundledDependencies #5924

Closed
@mibux

Description

@mibux

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

"npm pack" fails with an error while chokidar is included in bundledDependencies in the package.json

Expected Behavior

npm pack should pack chodikar into the archive

Steps To Reproduce

  1. create new folder an cd into it
  2. npm init -y
  3. npm install chokidar
  4. Add "chokidar" as bundledDependencies to package.json
  5. npm install -g npm@next-8
  6. npm pack --dry-run /* Works fine */
  7. npm install -g npm@latest /* As of now version 9.1.3*/
  8. npm pack --dry-run /* Fails */

Error message in the log file reads as this:

36 verbose stack TypeError: Cannot read properties of null (reading 'path')
36 verbose stack     at PackWalker.gatherBundles (C:\Users\<USER>\AppData\Roaming\npm\node_modules\npm\node_modules\npm-packlist\lib\index.js:387:25)
37 verbose cwd <CWD>
38 verbose Windows_NT 10.0.19044
39 verbose node v16.18.1
40 verbose npm  v9.1.3
41 error Cannot read properties of null (reading 'path')
42 verbose exit 1
43 timing npm Completed in 82ms
44 verbose unfinished npm timer command:pack 1670409046230
45 verbose code 1
46 error A complete log of this run can be found in:
46 error     C:\Users\<USER>\AppData\Local\npm-cache\_logs\2022-12-07T10_30_46_201Z-debug-0.log

Environment

  • npm: 9.1.3
  • Node.js: v16.18.1
  • OS Name: Windows_NT 10.0.19044 (Windows 10 Pro)
  • System Model Name:
  • npm config:
prefix = "C:\\Users\\<User>\\AppData\\Roaming\\npm"
location = "project"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingPriority 2secondary priority issueRelease 9.xwork is associated with a specific npm 9 releaseplatform:windowsis Windows-specific

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions