Git Product home page Git Product logo

Comments (5)

Electroid avatar Electroid commented on July 22, 2024

Not able to reproduce on macOS or an EC2 VM. Does the gitlab workflow happen to be public?

from bun.

Leni-Vienne avatar Leni-Vienne commented on July 22, 2024

Here is a repo reproducing the issue : https://github.com/Leni-Vienne/bun_dev_dependencies_issue
I've tried to narrow it down more but it gets quite unpredictable with the bun.lockb file in the way and I had to add some production dependencies to reproduce the bug

from bun.

Jarred-Sumner avatar Jarred-Sumner commented on July 22, 2024

Confirming I'm able to reproduce the issue locally.

Minimal reproduction:

Put this into package.json:

{
  "devDependencies": {
    "underscore": "1.9.1",
    "lodash": "4.17.21"
  }
}

Then run bun install.

It installs successfully:

bun install
bun install v1.0.32 (7c9f0763)

 + lodash@4.17.21
 + underscore@1.9.1 (v1.13.6 available)

 2 packages installed [183.00ms]

Then, manually edit your package.json to look like this:

{
  "devDependencies": {
    "underscore": "1.9.1",
    "lodash": "4.17.21"
  },
  "dependencies": {
    "lodash": "4.17.21"
  }
}

Note the "dependencies" there.

Then run bun install --production:

bun install --production
bun install v1.0.32 (7c9f0763)
4 |     "lodash": "4.17.21"
        ^
warn: Duplicate dependency: "lodash" specified in package.json
   at /Users/jarred/Desktop/reproo/package.json:4:5

7 |     "lodash": "4.17.21"
                  ^
note: "lodash" originally specified here
   at /Users/jarred/Desktop/reproo/package.json:7:15

Checked 1 install across 3 packages (no changes) [2.00ms]

It has a warning but overall installs successfully.

Now run bun install, without the --production flag:

~/Desktop/reproobun install
bun install v1.0.32 (7c9f0763)
4 |     "lodash": "4.17.21"
        ^
warn: Duplicate dependency: "lodash" specified in package.json
   at /Users/jarred/Desktop/reproo/package.json:4:5

7 |     "lodash": "^4.17.21"
                  ^
note: "lodash" originally specified here
   at /Users/jarred/Desktop/reproo/package.json:7:15
error: lodash@4.17.21 failed to resolve
error: underscore@1.9.1 failed to resolve

It reports that devDependencies failed to resolve.

Part of the problem is when --production is in use, we should never save the lockfile to disk.

from bun.

Jarred-Sumner avatar Jarred-Sumner commented on July 22, 2024

@Leni-Vienne are you using bun install --production?

from bun.

Leni-Vienne avatar Leni-Vienne commented on July 22, 2024

Yes i am indeed, but not sure yet if it's strictly necessary for the error to occur. Take a look at my repo above your last comment, it might help

from bun.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.