Skip to content

rnpm-plugin-windows fails when using npm#3998

Merged
acoates-ms merged 3 commits intomicrosoft:masterfrom
acoates-ms:npmcli
Jan 31, 2020
Merged

rnpm-plugin-windows fails when using npm#3998
acoates-ms merged 3 commits intomicrosoft:masterfrom
acoates-ms:npmcli

Conversation

@acoates-ms
Copy link
Copy Markdown
Contributor

@acoates-ms acoates-ms commented Jan 30, 2020

Fixes #3862

rnpm-plugin-windows was using a dependency that it wasn't declaring. Rather than having rnpm declare a specific react-native-community\cli dependency, which can cause issues since different RN versions require different versions of the CLI. I changed the dependency to use another package.

This also changes the CLI to only prompt the vnext/legacy prompt when used against RN 0.59. Since thats the only version that has a good legacy and vnext version.

If the user it using >=0.60 we will automatically use the vnext version.

Microsoft Reviewers: Open in CodeFlow

@acoates-ms acoates-ms requested a review from a team as a code owner January 30, 2020 21:41
@ghost ghost added the .NET label Jan 30, 2020
const chalk = require('chalk');
const execSync = require('child_process').execSync;
const path = require('path');
const prompt = require('@react-native-community/cli/build/tools/generator/promptSync').default();
Copy link
Copy Markdown
Contributor

@kmelmon kmelmon Jan 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vnext\local-cli\generator-common\index.js also require's and uses this module. Does that need to be changed as well? prompts looks better anyway.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thats in react-native-windows which declares the cli dep already.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That dependency is about to be removed when we move to 61

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If its removed the generator will have to be updated to not use it.

I expect that over time we will require the cli dependency as we work to properly implement auto-linking etc -- so maybe we should just keep the dependency and update it to match the same version range that react-native itself uses in 61.

Copy link
Copy Markdown
Contributor

@kmelmon kmelmon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@acoates-ms acoates-ms merged commit 089c8f4 into microsoft:master Jan 31, 2020
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.

react-native windows doesn't work after installing windows plug-in using npm

2 participants