Skip to content

[BUG] Cannot read properties of undefined (reading 'binPaths') when trying to use npx with workspaces and install-strategy=linked #9210

@james-pre

Description

@james-pre

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

I have a monorepo with workspaces set up (here). In it, I have two bins configured:

  1. In the root package.json, I have "bin": { "axium": "server/dist/main.js" }.
  2. In server/package.json, I have "bin": { "axium": "dist/main.js" }

No matter what, npx axium gives the following error:

npm warn reify The "linked" install strategy is EXPERIMENTAL and may contain bugs.
npm error Cannot read properties of undefined (reading 'binPaths')
npm error A complete log of this run can be found in: /home/jp/.npm/_logs/2026-04-08T20_06_05_367Z-debug-0.log

I've tried this in the project root, in the server workspace, and in other workspaces. All exhibit the same error.

In CI/CD, I get a different error when trying to use npx axium:

npm warn reify The "linked" install strategy is EXPERIMENTAL and may contain bugs.
npm warn tarball tarball data for @axium/server@file:../../../../../work/axium/axium/server (null) seems to be corrupted. Trying again.
npm warn tarball tarball data for @axium/server@file:../../../../../work/axium/axium/server (null) seems to be corrupted. Trying again.
npm error code ENOENT
npm error syscall open
npm error path /home/work/axium/axium/server/package.json
npm error errno -2
npm error enoent Could not read package.json: Error: ENOENT: no such file or directory, open '/home/work/axium/axium/server/package.json'
npm error enoent This is related to npm not being able to find a file.
npm error enoent
npm error A complete log of this run can be found in: /home/runner/.npm/_logs/2026-04-08T14_13_15_797Z-debug-0.log

Pulled from this Github Actions workflow run

Expected Behavior

npx should work correctly, even when install-strategy=linked is used.

Steps To Reproduce

  1. Create a monorepo using workspaces
  2. Use install-strategy=linked
  3. Define a bin for a file in one of the workspaces
  4. Attempt to use npx ... with the defined bin

Environment

  • npm: v11.12.1
  • Node.js: v24.13.1
  • OS Name: Fedora Linux 43
  • System Model Name: N/A
  • npm config:
; "user" config from /home/jp/.npmrc

//registry.npmjs.org/:_authToken = (protected)

; node bin location = /usr/bin/node-24
; node version = v24.13.1
; npm local prefix = /home/jp
; npm version = 11.12.1
; cwd = /home/jp
; HOME = /home/jp
; Run `npm config ls -l` to show all defaults.

I believe this may be related to #9166/#9167. I opened a new issue since that one is a defect with npm link while this issue deals with npx and shows a different error for local paths as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingPriority 2secondary priority issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions