cli icon indicating copy to clipboard operation
cli copied to clipboard

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

Open nparoski opened this issue 4 weeks ago • 2 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

This issue exists in the latest npm version

  • [x] 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.```

nparoski avatar Nov 26 '25 10:11 nparoski

#8553

ozz-oss avatar Nov 28 '25 16:11 ozz-oss

#8772

ozz-oss avatar Nov 28 '25 16:11 ozz-oss