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

yarn install --production complains about missing devDependencies #1115

Closed
Daniel15 opened this issue Oct 16, 2016 · 2 comments
Closed

yarn install --production complains about missing devDependencies #1115

Daniel15 opened this issue Oct 16, 2016 · 2 comments
Labels

Comments

@Daniel15
Copy link
Member

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
The package.json for Yarn itself has this devDependency:

  "devDependencies": {
    "eslint-plugin-yarn-internal": "file:scripts/eslint-rules",
  }

As part of building the distribution tarball, we run npm pack, extract the resulting tarball, run npm install --production to install just the prod dependencies, then archive the resulting files (see build-dist.sh and build-dist.ps1).

scripts/eslint-rules is only needed for dev builds and not for production builds, and we don't want to distribute it with Yarn,, so we do not copy it into the dist directory. npm install --production is fine with that, while yarn install --production complains:

λ yarn install --production
yarn install v0.15.1
[1/4] Resolving packages...
error "C:\\src\\yarn\\dist\\scripts\\eslint-rules" doesn't exist.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

If the current behavior is a bug, please provide the steps to reproduce.
git clone https://github.com/yarnpkg/yarn.git', modifyscripts/build-dist.ps1(on Windows) orscripts/build-dist.shto runyarn install --productionrather thannpm install --production`, watch it fail.

What is the expected behavior?
yarn install --production should ignore all issues relating to devDependencies

Please mention your node.js, yarn and operating system version.
Node.js v6.7.0
Windows 10 64-bit
Latest master of Yarn as of a few minutes ago

@sebmck
Copy link
Contributor

sebmck commented Oct 16, 2016

This is intentional behaviour. devDependencies need to be discoverable so we can build up the entire dependency graph. We omit dev nodes when in production and still take them into consideration when we perform the deduping hoisting so we get consistent module positions in the graph for dev and prod.

@sebmck sebmck closed this as completed Oct 16, 2016
@Daniel15
Copy link
Member Author

Ahh, that makes sense. I guess we'll have to do something special when building Yarn itself. Thanks!

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

No branches or pull requests

2 participants