renative
renative copied to clipboard
Windows: can't run app-harness or template_starter with npx
Describe the bug When I try to run app from renative monorepo app-harness or template_starter folder using "npx rnv run" I get error "MODULE_NOT_FOUND".
To Reproduce Steps to reproduce the behavior:
- Clone renative monorepo
- Run command 'yarn bootstrap' inside renative folder
- Run command 'yarn watch' inside renative folder
- Go to app-harness or template-starter
- Run command 'npx rnv run'
- See error 'MODULE_NOT_FOUND'
Expected behavior Program to run.
Screenshots or copy&paste
Desktop (please complete the following information):
- OS: windows 11
- Node Version v20.11.1
- RNV Version 1.0.0-rc.11
Tested this on my machine in attempt to look into the problem, it works with the npx, cannot reproduce cannot find module error, however it always prompts me to select an action and then platform to run regardless if I type npx rnv run
or npx rnv run -p web
as if I was just running npx rnv
Tested on Windows 10 Pro N, Version 22H2
Update: On the latest version it fails when trying to run Android with the issue that it tries to reach node_modules/node_modules/react-native/cli.js
.
_execute: npx react-native run-android --mode=Debug --no-packager --main-activity=SplashActivity --deviceId=emulator-5554
node:internal/modules/cjs/loader:1143
throw err;
^
Error: Cannot find module 'F:\Work\renative\node_modules\node_modules\react-native\cli.js'
at Module._resolveFilename (node:internal/modules/cjs/loader:1140:15)
at Module._load (node:internal/modules/cjs/loader:981:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12)
at node:internal/main/run_main_module:28:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Node.js v18.20.2
error: ⨯ ○ run: COMMAND:
npx react-native run-android --mode=Debug --no-packager --main-activity=SplashActivity --deviceId=emulator-5554
FAILED with ERROR:
Error: Command failed with exit code 1: npx react-native run-android --mode=Debug --no-packager --main-activity=SplashActivity --deviceId=emulator-5554
at makeError (F:\Work\renative\node_modules\execa\lib\error.js:60:11)
at handlePromise (F:\Work\renative\node_modules\execa\index.js:118:26)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
In the same way it fails to detect other engines. As an example running web on app-harness produces this error:
getMergedPlugin:@react-native-firebase/app
getMergedPlugin:react-native-photo-editor
getMergedPlugin:react-native-permissions
getMergedPlugin:react-native-google-cast
_execute: npx next dev --port 8090
node:internal/modules/cjs/loader:1143
throw err;
^
Error: Cannot find module 'F:\Work\renative\node_modules\node_modules\next\dist\bin\next'
at Module._resolveFilename (node:internal/modules/cjs/loader:1140:15)
at Module._load (node:internal/modules/cjs/loader:981:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:12)
at node:internal/main/run_main_module:28:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Node.js v18.20.2
error: ⨯ ○ run: COMMAND:
npx next dev --port 8090
FAILED with ERROR:
Error: Command failed with exit code 1: npx next dev --port 8090
at makeError (F:\Work\renative\node_modules\execa\lib\error.js:60:11)
at handlePromise (F:\Work\renative\node_modules\execa\index.js:118:26)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
Tested on Windows 10 Pro N, Version 22H2, using release/1.0
branch, with the latest release being 1.0.0-rc.18
1.0.0-rc.18
-
npx rnv run
-> works:
C:\Users\dev\Desktop\renative\packages\template-starter>npx rnv run
┌─────────────────────────────────────────────────────────────────┐
│ ██████╗ ███████╗███╗ ██╗ █████╗ ████████╗██╗██╗ ██╗███████╗ │
│ ██╔══██╗██╔════╝████╗ ██║██╔══██╗╚══██╔══╝██║██║ ██║██╔════╝ │
│ ██████╔╝█████╗ ██╔██╗ ██║███████║ ██║ ██║██║ ██║█████╗ │
│ ██╔══██╗██╔══╝ ██║╚██╗██║██╔══██║ ██║ ██║╚██╗ ██╔╝██╔══╝ │
│ ██║ ██║███████╗██║ ╚████║██║ ██║ ██║ ██║ ╚████╔╝ ███████╗ │
│ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═══╝ ╚══════╝ │
│ RNV v:1.0.0-rc.18 | renative.org | 06/05/2024, 14:00:30 │
│ $ rnv run │
└─────────────────────────────────────────────────────────────────┘
? Pick a platform for task: "rnv run" (Use arrow keys)
> ios
android
androidtv
firetv
androidwear
web
tizen
(Move up and down to reveal more choices)
-
npx rnv run -p web
-> works:
C:\Users\dev\Desktop\renative\packages\template-starter>npx rnv run -p web
┌─────────────────────────────────────────────────────────────────┐
│ ██████╗ ███████╗███╗ ██╗ █████╗ ████████╗██╗██╗ ██╗███████╗ │
│ ██╔══██╗██╔════╝████╗ ██║██╔══██╗╚══██╔══╝██║██║ ██║██╔════╝ │
│ ██████╔╝█████╗ ██╔██╗ ██║███████║ ██║ ██║██║ ██║█████╗ │
│ ██╔══██╗██╔══╝ ██║╚██╗██║██╔══██║ ██║ ██║╚██╗ ██╔╝██╔══╝ │
│ ██║ ██║███████╗██║ ╚████║██║ ██║ ██║ ██║ ╚████╔╝ ███████╗ │
│ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═══╝ ╚══════╝ │
│ RNV v:1.0.0-rc.18 | renative.org | 06/05/2024, 14:01:23 │
│ $ rnv run -p web │
└─────────────────────────────────────────────────────────────────┘
info: Current engine: @rnv/engine-rn-next (C:\Users\dev\Desktop\renative\packages\engine-rn-next)
task: ○ run ↺1
info: Build hooks not complied. BUILDING...
task: ○ configure ↺1
task: ○ platform configure ↺1
task: ○ project configure ↺1
info: Creating folder C:\Users\dev\Desktop\renative\packages\template-starter\platformBuilds ...DONE
info: .rnv folder missing. CREATING...DONE
info: .rnv/schemas folder missing. CREATING...DONE
task: ○ workspace configure ↺1
task: ✔ workspace configure
info: ✔ \@react-native-community\cli-platform-ios\build\tools\listIOSDevices.js requires override by: \@rnv\config-templates\pluginTemplates\@react-native-community\cli-platform-ios\[email protected]. FIXING...DONE
info: ✔ \@react-native-community\cli\build\bin.js requires override by: \@rnv\config-templates\pluginTemplates\@react-native-community\cli\overrides.json. FIXING...DONE
info: ✔ \react-native-tvos\Libraries\Components\ScrollView\ScrollViewNativeComponent.js requires override by: \@rnv\config-templates\pluginTemplates\react-native-tvos\overrides.json. FIXING...DONE
info: ✔ \react-native-tvos\Libraries\Components\ScrollView\ScrollViewNativeComponent.js requires override by: \@rnv\config-templates\pluginTemplates\react-native-tvos\overrides.json. FIXING...DONE
task: ○ app configure ↺1
? Which one would you like to pick? template
info: Current app config: template
warn: ○ project configure: Updates to package.json are required: (only info. skipping due to template mode)
- raf (N/A) => (3.4.1) Missing dependency for platform tizen | engine.npm (@rnv/engine-rn-web)
task: ✔ app configure
info: C:\Users\dev\Desktop\renative\node_modules\@react-native-community\cli-platform-ios\build\tools\listIOSDevices.js overriden by: \@rnv\config-templates\pluginTemplates\@react-native-community\cli-platform-ios\[email protected]
info: C:\Users\dev\Desktop\renative\node_modules\@react-native-community\cli\build\bin.js overriden by: \@rnv\config-templates\pluginTemplates\@react-native-community\cli\overrides.json
info: C:\Users\dev\Desktop\renative\node_modules\react-native-tvos\Libraries\Components\ScrollView\ScrollViewNativeComponent.js overriden by: \@rnv\config-templates\pluginTemplates\react-native-tvos\overrides.json
info: C:\Users\dev\Desktop\renative\node_modules\react-native-tvos\Libraries\Components\ScrollView\ScrollViewNativeComponent.js overriden by: \@rnv\config-templates\pluginTemplates\react-native-tvos\overrides.json
task: ✔ project configure
info: Current Build Scheme: debug
task: ✔ platform configure
info: Found custom assetSources at C:\Users\dev\Desktop\renative\node_modules\@flexn\assets-renative-outline\assets\web. Will be used to generate assets.
task: ✔ configure
info: Your web devServerHost 127.0.0.1 at port 8080 is not running. Starting it up for you...
┌─────────────────────────────────────────────────────────────────┐
│ ⚠ BUNDLER STARTED | 06/05/2024, 14:01:33 | [email protected] │
│ $ rnv run -p web │
├─────────────────────────────────────────────────────────────────┤
│ Project: @rnv/[email protected] │
│ Workspace: rnv │
│ Platform (-p): web │
│ Engine: @rnv/engine-rn-next │
│ Template: @rnv/template-starter │
│ App Config (-c): template │
│ Build Scheme (-s): debug │
│ Supported Platforms: ios, android, androidtv, firetv, androidwear, web, tizen, tvos, webos, macos, tizenwatch, kaios, chromecast, linux
│ Env Info: win32 | x64 | node v18.19.0 │
│ Executed Time: 0h:0m:9s:797ms │
│ info: ✔ \@react-native-community\cli-platform-ios\build\tools\listIOSDevices.js requires override by: \@rnv\config-templates\pluginTemplates\@react-native-community\cli-platform-ios\[email protected]. FIXING...DONE
│ info: ✔ \@react-native-community\cli\build\bin.js requires override by: \@rnv\config-templates\pluginTemplates\@react-native-community\cli\overrides.json. FIXING...DONE
│ info: ✔ \react-native-tvos\Libraries\Components\ScrollView\ScrollViewNativeComponent.js requires override by: \@rnv\config-templates\pluginTemplates\react-native-tvos\overrides.json. FIXING...DONE
│ warn: ○ project configure: Updates to package.json are required: (only info. skipping due to template mode)
│ Project location: C:\Users\dev\Desktop\renative\packages\template-starter\platformBuilds\template_web
└─────────────────────────────────────────────────────────────────┘
Dev server running at: http://127.0.0.1:8080
{ app: undefined }
warn: ○ run: Can't connect to host http://127.0.0.1:8080/. Try restarting it.
▲ Next.js 14.1.4
- Local: http://localhost:8080
We detected TypeScript in your project and reconfigured your tsconfig.json file for you. Strict-mode is set to false by default.
The following suggested values were added to your tsconfig.json. These values can be changed to fit your project's needs:
- include was updated to add 'platformBuilds\template_web\output/types/**/*.ts'
Disabled SWC as replacement for Babel because of custom Babel configuration "babel.config.js" https://nextjs.org/docs/messages/swc-disabled
✓ Ready in 17.8s
○ Compiling / ...
Using external babel configuration from C:\Users\dev\Desktop\renative\packages\template-starter\babel.config.js
✓ Compiled / in 49.8s (481 modules)
TouchableOpacity is deprecated. Please use Pressable.
focusable is deprecated.
Tested on Windows 10 Pro, Version 22H2 Node version: 18.19.0