Skip to content

[BUG] npm install throws "ERR_INVALID_ARG_TYPE" if empty yarn.lock folder is present in root directory. #8782

@nparoski

Description

@nparoski

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 install

npm error code ERR_INVALID_ARG_TYPE
npm error The "path" argument must be of type string or an instance of Buffer or URL. Received null
npm error A complete log of this run can be found in: /Users/nparoski/.npm/_logs/2025-11-26T10_05_44_942Z-debug-0.log

Expected Behavior

Expected to install packages without issues.

Steps To Reproduce

  1. npm init
  2. npm install <package name>
  3. mkdir yarn.lock
  4. npm install

Environment

  • npm: 10.9.0
  • Node.js: 22.10.0
  • OS Name: MacOS / Ubuntu
  • System Model Name: macOS Sequoia / Ubuntu 22
  • npm config:
; node bin location = /Users/nparoski/.nvm/versions/node/v22.10.0/bin/node
; node version = v22.10.0
; npm local prefix = /Users/nparoski/projects/npm-test
; npm version = 10.9.0
; cwd = /Users/nparoski/projects/npm-test
; HOME = /Users/nparoski
; Run `npm config ls -l` to show all defaults.```

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next steps

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions