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:)
- npx react-native init react_native_windows_todo --version ^0.61.5
- cd react_native_windows_todo
- 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
[email protected] 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'
Most helpful comment
@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.