Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bun keep install devDependencies on project #15107

Closed
indrazm opened this issue Nov 12, 2024 · 2 comments · Fixed by #15874
Closed

Bun keep install devDependencies on project #15107

indrazm opened this issue Nov 12, 2024 · 2 comments · Fixed by #15874
Labels
bug Something isn't working bun install Something that relates to the npm-compatible client

Comments

@indrazm
Copy link

indrazm commented Nov 12, 2024

What version of Bun is running?

1.1.21+70ca2b76c

What platform is your computer?

Linux 5.15.153.1-microsoft-standard-WSL2 x86_64 x86_64

What steps can reproduce the bug?

I am currently build an npm package with bun.
However when i do install. It will install extraneous dependencies.

if i do bun i it will install me all dependencies, even the devDependencies.
But if i do npm i it will install me only dependencies, NOT devDependencies.

Here is my package.json.

{
    "name": "litojs",
    "version": "0.0.1",
    "main": "src/index.ts",
    "type": "module",
    "exports": {
        ".": "./src/index.ts"
    },
    "scripts": {
        "lint": "bunx eslint ./src"
    },
    "devDependencies": {
        "@types/bun": "latest",
        "@eslint/js": "^9.14.0",
        "@types/eslint__js": "^8.42.3",
        "eslint": "^9.14.0",
        "eslint-plugin-simple-import-sort": "^12.1.1",
        "typescript-eslint": "^8.13.0"
    },
    "peerDependencies": {
        "typescript": "^5.6.3"
    },
    "dependencies": {
        "chalk": "^5.3.0"
    }
}

What is the expected behavior?

The expected behaviour is only Install Dependencies, without devDependencies.

What do you see instead?

This is when i do install using bun.
Image

This is when i do install using npm.
Image

Additional information

No response

@indrazm indrazm added bug Something isn't working needs triage labels Nov 12, 2024
@dylan-conway
Copy link
Member

Do you have omit=dev in a .npmrc file? I believe this is happening because bun isn't reading the omit config setting

@dylan-conway dylan-conway added the bun install Something that relates to the npm-compatible client label Nov 12, 2024
@indrazm
Copy link
Author

indrazm commented Nov 13, 2024

Hey @dylan-conway yes. it's there. But still installing the devDependencies.
Here is what i have did :

npm ci ✅ 
npm i ✅ 

bun i ❌ 
bun i --production ❌ 
bun i --omit=dev ❌ 

✅ installing only dependencies
❌ include the devDependencies

Current way to fix this at the moment is : npm prune

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working bun install Something that relates to the npm-compatible client
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants