yarnpkg/yarn

Possibility to add warning when running yarn in directory containing node_modules but missing yarn.lock

Open

#3,373 建立於 2017年5月10日

在 GitHub 查看
 (8 留言) (0 反應) (0 負責人)JavaScript (41,514 star) (2,731 fork)batch import
cat-featuregood first issuetriaged

描述

Would it be possible to add some kind of warning when running yarn inside directory where node_modules already exist, but there is no yarn.lock file?

The only use-case for this should be when migrating from npm to yarn. I realized yarn updated all my node_modules only after I ran yarn command and then it was too late to search for yarn import.

It would be nice to get warning, that running yarn or yarn install without yarn.lock will result in node_modules being downloaded and updated.

I realize this experience is depending on environment, but the destructive nature of such simple mistake could warrant some kind of protection against it.

Alternatively, running yarn command in this specific case, could by default fallback to yarn import command instead of yarn install.

Also yarn import command could be mentioned on https://yarnpkg.com/lang/en/docs/migrating-from-npm/ page.

貢獻者指南