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

Installing for production fails if dev dependency is missing. #8707

Open
opkna opened this issue Oct 16, 2021 · 1 comment
Open

Installing for production fails if dev dependency is missing. #8707

opkna opened this issue Oct 16, 2021 · 1 comment

Comments

@opkna
Copy link

opkna commented Oct 16, 2021

I think this is a bug at least.

Consider this example, I have two modules in one project: main_module and asset_module.
main_module have asset_module as a dev dependency like this:

main_module/package.json

{
    "name": "main_module",
    "devDependencies": {
        "asset_module": "../asset_module"
    }
}

Now lets say I'm installing dependencies for production with: yarn install --production.
Yarn will not include asset_module in node_modules since it's in devDependencies.

However if asset_module is missing the install command fails anyways:

error Package "asset_module" refers to a non-existing file '"/home/user/project/asset_module"'.

It seems unnecessary that modules that will be ignored have to be there. The scenario where I've encountered this is when using yarn in docker. I don't copy in the dependencies that I don't need so the install command fails.

Please enlighten me if I'm missing a reason to have the module there even if it's not to be installed.

Using Yarn 1.22.11

@dixler
Copy link

dixler commented Feb 22, 2022

seemingly related issues
#3577
#6323
#4646

discussion: #3630

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants