Skip to content
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

Update getting started documentation to recommend 0.61 instead of 0.60 #4436

Closed
chrisglein opened this issue Mar 26, 2020 · 13 comments
Closed

Comments

@chrisglein
Copy link
Member

These docs: https://microsoft.github.io/react-native-windows/docs/getting-started

Should update from this:

npx react-native init <project name> --version ^0.60.0

to instead point to 0.61, now that it's out of beta.

@chrisglein chrisglein added this to the 0.62 (M5) milestone Mar 26, 2020
@ghost ghost added the Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) label Mar 26, 2020
@chrisglein
Copy link
Member Author

Also, as we're building up a release checklist, this should be on the list.

@acoates-ms
Copy link
Contributor

While we are updating the instructions, I've streamlined the init process:

OLD:

npx react-native init <myproject> --version 0.61.5
cd <myproject>
yarn add rpnm-react-native-windows
npx react-native windows

NEW:

npx react-native init <myproject> --version 0.61.5
cd <myproject>
npx react-native-windows-init

@NickGerleman
Copy link
Collaborator

NickGerleman commented Mar 26, 2020

npx react-native init <project name> --version ^0.60.0

I don't think the hat in ^0.60.0 works correctly without quotes. IIRC I saw a bug about that somewhere?

Though also I think specific versions are safer since patch releases might still break us.

@acoates-ms
Copy link
Contributor

yeah, the CLI doesn't support ranges, you have to specify a specific version, so it should be 0.61.5

@chrisglein chrisglein removed the Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) label Mar 27, 2020
@kikisaints
Copy link
Contributor

kikisaints commented Mar 31, 2020

@chrisglein can you log these types of issues over on the samples/website repo in the future? That would help me a lot 😅

Edit: Also, what's our Beta version now if that's still a thing?

@acoates-ms
Copy link
Contributor

acoates-ms commented Apr 3, 2020

npx --ignore-existing react-native init <myproject> --template react-native@^0.61 apparently works. So we should probably use that.

(added the --ignore-existing to work around an issue if people ran npm install -g react-native previously, and so have an old version laying around.)

@NickGerleman
Copy link
Collaborator

I thought we were concerned at one point that patch releases could still break us. Is this not the case?

@acoates-ms
Copy link
Contributor

I think its ok to default to taking patch fixes. And if they break we'll find out. Otherwise no-one will tell us.

@tejaat1995
Copy link

Hello acoates-ms I am getting this error while executing this below commands

npx react-native init react_native_windows_todo --version 0.61.5
cd react_native_windows_todo
npx react-native-windows-init

Environment

react-native -v:

  • react-native-cli: 2.0.1
  • react-native: 0.61.5

react-native run-windows --info:

System:

  • OS: Windows 10 10.0.18363
  • CPU: (4) x64 Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
  • Memory: 2.48 GB / 7.90 GB
    Binaries:
  • Node: 12.16.2 - C:\Program Files\nodejs\node.EXE
  • npm: 6.13.4 - C:\Program Files\nodejs\npm.CMD
    npmPackages:
  • react: 16.9.0 => 16.9.0
  • react-native: 0.61.5 => 0.61.5
  • react-native-windows: ^0.61.3 => 0.61.3
  • rnpm-plugin-windows: ^0.6.1 => 0.6.1
    Installed UWP SDKs:
  • 10.0.10240.0
  • 10.0.10586.0
  • 10.0.15063.0
  • 10.0.16299.0
  • 10.0.17134.0
  • 10.0.17763.0
  • 10.0.18362.0

Target Env:

  • Target Platform Version(s): 10.0.18362
  • Target Device(s): Desktop
  • Visual Studio Version: Visual Studio 2017
  • Build Configuration: Debug

Steps to Reproduce

(Write your steps here:)

  1. npx react-native init react_native_windows_todo --version ^0.61.5
  2. cd react_native_windows_todo
  3. npx react-native-windows-init

Expected Behavior

The expecting project has to create and run successfully.

Actual Behavior

But, getting an error while creating a project

react-native-windows@0.61.3 successfully installed.
Cannot find module '@react-native-community/cli/build/tools/copyAndReplace'
Require stack:

  • F:\Vs Apps\react_native_windows_todo\node_modules\react-native-windows\local-cli\generator-common\index.js
  • F:\Vs Apps\react_native_windows_todo\node_modules\react-native-windows\local-cli\generator-windows\index.js
  • F:\Vs Apps\react_native_windows_todo\node_modules\react-native-windows\local-cli\generate-windows.js
  • F:\Vs Apps\react_native_windows_todo\node_modules\rnpm-plugin-windows\src\windows.js
  • F:\Vs Apps\react_native_windows_todo\node_modules\rnpm-plugin-windows\index.js
  • F:\Vs Apps\react_native_windows_todo\node_modules\rnpm-plugin-windows\react-native.config.js
  • F:\Vs Apps\react_native_windows_todo\node_modules\import-fresh\index.js
  • F:\Vs Apps\react_native_windows_todo\node_modules\cosmiconfig\dist\loaders.js
  • F:\Vs Apps\react_native_windows_todo\node_modules\cosmiconfig\dist\createExplorer.js
  • F:\Vs Apps\react_native_windows_todo\node_modules\cosmiconfig\dist\index.js
  • F:\Vs Apps\react_native_windows_todo\node_modules\react-native\node_modules@react-native-community\cli\build\tools\config\readConfigFromDisk.js
  • F:\Vs Apps\react_native_windows_todo\node_modules\react-native\node_modules@react-native-community\cli\build\tools\config\index.js
  • F:\Vs Apps\react_native_windows_todo\node_modules\react-native\node_modules@react-native-community\cli\build\commands\install\install.js
  • F:\Vs Apps\react_native_windows_todo\node_modules\react-native\node_modules@react-native-community\cli\build\commands\index.js
  • F:\Vs Apps\react_native_windows_todo\node_modules\react-native\node_modules@react-native-community\cli\build\index.js
  • F:\Vs Apps\react_native_windows_todo\node_modules\react-native\cli.js
  • c:\Users\Admin\AppData\Roaming\npm\node_modules\react-native-cli\index.js
    Error: Cannot find module '@react-native-community/cli/build/tools/copyAndReplace'
    Require stack:
  • F:\Vs Apps\react_native_windows_todo\node_modules\react-native-windows\local-cli\generator-common\index.js
  • F:\Vs Apps\react_native_windows_todo\node_modules\react-native-windows\local-cli\generator-windows\index.js
  • F:\Vs Apps\react_native_windows_todo\node_modules\react-native-windows\local-cli\generate-windows.js
  • F:\Vs Apps\react_native_windows_todo\node_modules\rnpm-plugin-windows\src\windows.js
  • F:\Vs Apps\react_native_windows_todo\node_modules\rnpm-plugin-windows\index.js
  • F:\Vs Apps\react_native_windows_todo\node_modules\rnpm-plugin-windows\react-native.config.js
  • F:\Vs Apps\react_native_windows_todo\node_modules\import-fresh\index.js
  • F:\Vs Apps\react_native_windows_todo\node_modules\cosmiconfig\dist\loaders.js
  • F:\Vs Apps\react_native_windows_todo\node_modules\cosmiconfig\dist\createExplorer.js
  • F:\Vs Apps\react_native_windows_todo\node_modules\cosmiconfig\dist\index.js
  • F:\Vs Apps\react_native_windows_todo\node_modules\react-native\node_modules@react-native-community\cli\build\tools\config\readConfigFromDisk.js
  • F:\Vs Apps\react_native_windows_todo\node_modules\react-native\node_modules@react-native-community\cli\build\tools\config\index.js
  • F:\Vs Apps\react_native_windows_todo\node_modules\react-native\node_modules@react-native-community\cli\build\commands\install\install.js
  • F:\Vs Apps\react_native_windows_todo\node_modules\react-native\node_modules@react-native-community\cli\build\commands\index.js
  • F:\Vs Apps\react_native_windows_todo\node_modules\react-native\node_modules@react-native-community\cli\build\index.js
  • F:\Vs Apps\react_native_windows_todo\node_modules\react-native\cli.js
  • c:\Users\Admin\AppData\Roaming\npm\node_modules\react-native-cli\index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)
    at Function.Module._load (internal/modules/cjs/loader.js:862:27)
    at Module.require (internal/modules/cjs/loader.js:1042:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object. (F:\Vs Apps\react_native_windows_todo\node_modules\react-native-windows\local-cli\generator-common\index.js:4:24)
    at Module._compile (internal/modules/cjs/loader.js:1156:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10)
    at Module.load (internal/modules/cjs/loader.js:1000:32)
    at Function.Module._load (internal/modules/cjs/loader.js:899:14)
    at Module.require (internal/modules/cjs/loader.js:1042:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    'F:\Vs Apps\react_native_windows_todo\node_modules\react-native-windows\local-cli\generator-common\index.js',
    'F:\Vs Apps\react_native_windows_todo\node_modules\react-native-windows\local-cli\generator-windows\index.js',
    'F:\Vs Apps\react_native_windows_todo\node_modules\react-native-windows\local-cli\generate-windows.js',
    'F:\Vs Apps\react_native_windows_todo\node_modules\rnpm-plugin-windows\src\windows.js',
    'F:\Vs Apps\react_native_windows_todo\node_modules\rnpm-plugin-windows\index.js',
    'F:\Vs Apps\react_native_windows_todo\node_modules\rnpm-plugin-windows\react-native.config.js',
    'F:\Vs Apps\react_native_windows_todo\node_modules\import-fresh\index.js',
    'F:\Vs Apps\react_native_windows_todo\node_modules\cosmiconfig\dist\loaders.js',
    'F:\Vs Apps\react_native_windows_todo\node_modules\cosmiconfig\dist\createExplorer.js',
    'F:\Vs Apps\react_native_windows_todo\node_modules\cosmiconfig\dist\index.js',
    'F:\Vs Apps\react_native_windows_todo\node_modules\react-native\node_modules\@react-native-community\cli\build\tools\config\readConfigFromDisk.js',
    'F:\Vs Apps\react_native_windows_todo\node_modules\react-native\node_modules\@react-native-community\cli\build\tools\config\index.js',
    'F:\Vs Apps\react_native_windows_todo\node_modules\react-native\node_modules\@react-native-community\cli\build\commands\install\install.js',
    'F:\Vs Apps\react_native_windows_todo\node_modules\react-native\node_modules\@react-native-community\cli\build\commands\index.js',
    'F:\Vs Apps\react_native_windows_todo\node_modules\react-native\node_modules\@react-native-community\cli\build\index.js',
    'F:\Vs Apps\react_native_windows_todo\node_modules\react-native\cli.js',
    'c:\Users\Admin\AppData\Roaming\npm\node_modules\react-native-cli\index.js'

@kikisaints
Copy link
Contributor

@chrisglein this issue is fixed, however we have an issue from someone around trying to execute the commands. Should we close this?

@acoates-ms have you gotten a chance to take a look at the issue @tejaat1995 commented?

@acoates-ms
Copy link
Contributor

@tejaat1995 this is caused by a stale version of react-native installed globally on your machine. please uninstall your global copy of react-native. Or update it.

npm uninstall -g react-native

@acoates-ms
Copy link
Contributor

@kikisaints we should probably document this error, since the old recommendation of installing react native globally will have left many people with stale bits on their machine - and is why it's no longer recommended.

@chrisglein
Copy link
Member Author

I've added an issue on the samples repo to capture that troubleshooting tip:
microsoft/react-native-windows-samples#67
Closing this issue as we have update the docs to point to 61.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants