bun icon indicating copy to clipboard operation
bun copied to clipboard

Support native file dependency linking in package json

Open renhiyama opened this issue 2 years ago • 0 comments

What version of Bun is running?

3.0.0

What platform is your computer?

WSL x86_64

What steps can reproduce the bug?

Consider this package.json:

{
  "name": "reest",
  "dependencies": {
    "@reejs/imports": "file:../imports",
    "@reejs/imports/environment.js": "file:../imports/environment.js",
    "@reejs/imports/worker.js": "file:../imports/worker.js",
    "hono-node": "file:./.cache/storage/local/https/esm.sh/@honojs/[email protected]",
    "hono-deno": "file:./.cache/storage/local/https/deno.land/std/http/server.ts.js",
    "hono": "file:./.cache/storage/local/https/esm.sh/hono.js"
  }
}

the dependencies link to local files, which is allowed on nodejs by running npm i on it. But bun i shows an error.

How often does it reproduce? Is there a required condition?

It will reproduce always.

What is the expected behavior?

According to https://docs.npmjs.com/cli/v9/configuring-npm/package-json#local-paths Bun should link the local files to node modules folder as npm does.

What do you see instead?

bun install v0.3.0 (0b94ccdf)
error: @reejs/imports/environment.js@file:../imports/environment.js failed to resolve
error: @reejs/imports/worker.js@file:../imports/worker.js failed to resolve
error: hono-deno@file:./.cache/storage/local/https/deno.land/std/http/server.ts.js failed to resolve
error: hono-node@file:./.cache/storage/local/https/esm.sh/@honojs/[email protected] failed to resolve

Additional information

No response

renhiyama avatar Dec 08 '22 11:12 renhiyama