Install ALL dependencies and devDependencies before prepare #1186
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The old fix for installing only devDependencies before preparing the project has a problem:
npm install <devPackagesNames>
does not respect the versions from the devDependencies section and always installs the latest versions.We cannot use
npm install <devPackageName>@<version>
as we do not know if they are real versions or paths or even "frog legs".There's a magical flag
--dev
which should allow you to do:npm install <devPackagesNames> --dev
and it will respect the versions from devDependencies. Unfortunately this flag forces recursive installation of devDependencies all down the tree of packages.Of course npm has another rabbit in the hat -
--only=dev
. However I couldn't get it work at all.So the only solution I could think about is to install all dependencies before preparing the project.