Skip to content

fix: issues when yarn is set as package manager #4233

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

Merged
merged 2 commits into from
Dec 14, 2018

Conversation

rosen-vladimirov
Copy link
Contributor

@rosen-vladimirov rosen-vladimirov commented Dec 14, 2018

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 the pacote 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 set

When yarn is set as package manager, tns update command fails. The problem is that during command's execution, we try to remove tns-core-modules-widgets from the project. When tns-core-modules-widgets pacakage is not a dependency of the project (this is the default case as this package is dependency of tns-core-modules not a direct dependency of the project), calling yarn 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, calling tns create myApp --js hangs on Windows.
tns update command always fails when yarn 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

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 the `pacote` package hangs instead of just failing.
Fix this by trimming the result of `yarn cache dir` call.
When yarn is set as package manager, `tns update` command fails. The problem is that during command's execution, we try to remove `tns-core-modules-widgets` from the project. When `tns-core-modules-widgets` pacakage is not a dependency of the project (this is the default case as this package is dependency of `tns-core-modules` not a direct dependency of the project), calling `yarn 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.
@rosen-vladimirov rosen-vladimirov added this to the 5.1.1 milestone Dec 14, 2018
@rosen-vladimirov rosen-vladimirov self-assigned this Dec 14, 2018
@rosen-vladimirov rosen-vladimirov merged commit 95e9cbb into release Dec 14, 2018
@rosen-vladimirov rosen-vladimirov deleted the vladimirov/fix-yarn branch December 14, 2018 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants