fix: issues when yarn is set as package manager #4233
Merged
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.
fix: unable to use yarn on Windows
When you've set package manager to
yarn
on Windows, CLI is unable to create a project - it hangs during the operation. The problem is that getting the path to yarn cache returns result with\n
at the end. This makes thepacote
package hangs instead of just failing.Fix this by trimming the result of
yarn cache dir
call.fix:
tns update
does not work when yarn is setWhen yarn is set as package manager,
tns update
command fails. The problem is that during command's execution, we try to removetns-core-modules-widgets
from the project. Whentns-core-modules-widgets
pacakage is not a dependency of the project (this is the default case as this package is dependency oftns-core-modules
not a direct dependency of the project), callingyarn remove
fails.In the same case
npm
does not fail.To resolve the issue, check if
tns-core-modules-widgets
are dependency of the project and uninstall this package only in such case.PR Checklist
What is the current behavior?
When you've set
yarn
as package manager, callingtns create myApp --js
hangs on Windows.tns update
command always fails whenyarn
is set as package manager.What is the new behavior?
You can set yarn as package manager and use it on Windows. Also you can use
tns update
on all OSes.Fixes issues: #4228 and #4234