electrode-io / electrode-native

A platform to ease integration&delivery of React Native apps in existing mobile applications
https://native.electrode.io
Other
727 stars 113 forks source link

execute ern run-android error message comes #1772

Open chc7042 opened 3 years ago

chc7042 commented 3 years ago

when i try to create minapp based on https://www.electrode.io/site/docs/getting_started.html i'm getting below error

    × Bundling MiniApps 5s
      × Running Metro Bundler 5s
× An error occurred: Command failed: C:\Users\nicolas.choi\.ern\versions\0.45.5\node_modules\ern-core\node_modules\.bin\react-native bundle --entry-file=index.android.js --dev=false --platform=android --bundle-output=C:\Users\nicolas.cho
i\.ern\containergen\out\android\lib\src\main\assets\index.android.bundle --assets-dest=C:\Users\nicolas.choi\.ern\containergen\out\android\lib\src\main\res\bundle
Failed to construct transformer:  { Error: Cannot parse C:\Users\NICOLA~1.CHO\AppData\Local\Temp\tmp-16072IgR6kWrCTeiW\D:\ADT\Workspace\electrode\sample\firstminiapp\package.json as JSON: ENOENT: no such file or directory, open 'C:\Users
\NICOLA~1.CHO\AppData\Local\Temp\tmp-16072IgR6kWrCTeiW\D:\ADT\Workspace\electrode\sample\firstminiapp\package.json'
    at Object.<anonymous> (C:\Users\NICOLA~1.CHO\AppData\Local\Temp\tmp-16072IgR6kWrCTeiW\node_modules\jest-haste-map\build\worker.js:167:15)
    at Generator.next (<anonymous>)
    at asyncGeneratorStep (C:\Users\NICOLA~1.CHO\AppData\Local\Temp\tmp-16072IgR6kWrCTeiW\node_modules\jest-haste-map\build\worker.js:78:24)
    at _next (C:\Users\NICOLA~1.CHO\AppData\Local\Temp\tmp-16072IgR6kWrCTeiW\node_modules\jest-haste-map\build\worker.js:98:9)
    at C:\Users\NICOLA~1.CHO\AppData\Local\Temp\tmp-16072IgR6kWrCTeiW\node_modules\jest-haste-map\build\worker.js:103:7
    at new Promise (<anonymous>)
    at Object.<anonymous> (C:\Users\NICOLA~1.CHO\AppData\Local\Temp\tmp-16072IgR6kWrCTeiW\node_modules\jest-haste-map\build\worker.js:95:12)
    at Object.worker (C:\Users\NICOLA~1.CHO\AppData\Local\Temp\tmp-16072IgR6kWrCTeiW\node_modules\jest-haste-map\build\worker.js:120:18)
    at execFunction (C:\Users\NICOLA~1.CHO\AppData\Local\Temp\tmp-16072IgR6kWrCTeiW\node_modules\jest-worker\build\workers\processChild.js:155:17)
    at execHelper (C:\Users\NICOLA~1.CHO\AppData\Local\Temp\tmp-16072IgR6kWrCTeiW\node_modules\jest-worker\build\workers\processChild.js:139:5) type: 'Error' }
error Cannot parse C:\Users\NICOLA~1.CHO\AppData\Local\Temp\tmp-16072IgR6kWrCTeiW\D:\ADT\Workspace\electrode\sample\firstminiapp\package.json as JSON: ENOENT: no such file or directory, open 'C:\Users\NICOLA~1.CHO\AppData\Local\Temp\tmp-
16072IgR6kWrCTeiW\D:\ADT\Workspace\electrode\sample\firstminiapp\package.json'. Run CLI with --verbose flag for more details.

manually i try to create bundle via react-native bundle then it is okay but ern run-android does not work at this time please help me

chc7042 commented 3 years ago

add more when i try to react-native run-android then it is okay but only ern run-android had met a problem i think this caused from invalid lookup directory as below C:\Users \NICOLA1.CHO\AppData\Local\Temp\tmp-16072IgR6kWrCTeiW\D:\ADT\Workspace\electrode\sample\firstminiapp\package.json'

please help me

chc7042 commented 3 years ago

i tried to change npm and node version using nvm from 10.xx ~ 14.16 but issue occurs again. and more i tried to change worker.js but it does not work. anybody help me...

friederbluemle commented 3 years ago

Hi @chc7042 - Yes, it looks like there is a problem constructing the path.. Can you provide some more details about your environment? Which Windows version are you running? Are you using the command prompt or powershell/bash? Also, please provide exact repro steps (i.e. which ern commands did you run to produce the error in the first post?).

chc7042 commented 3 years ago

Hi @friederbluemle i am using Windows 10 (20HS) and i tried to ern run-android via git bash, cmd and power shell. finally result is same.

  1. npm install -g elecrode-native
  2. git clone https://github.com/electrode-io/movielist-miniapp.git ( later time i tried to via ern create-miniapp )
  3. ern run-android
  4. error occured
  5. after then change cmd. power shell, git bash but it is same

node 14.16, npm 6.14.11, yarn 1.22.5, ern-native 1.1.1 ern 0.46.0

friederbluemle commented 3 years ago

Hi @chc7042 - Yes, you're right, there has been an issue with this miniapp for a while. Sorry for the confusion. Can you please try the following repo instead and see if you can get it to run:

https://github.com/electrode-io/movies-reloaded-miniapp

chc7042 commented 3 years ago

Hi @friederbluemle it is sad news. result is same × Bundling MiniApps 13s × Running Metro Bundler 13s × An error occurred: Command failed: C:\Users\chc70.ern\versions\0.46.0\node_modules\ern-core\node_modules.bin\react-n ative bundle --entry-file=index.android.js --dev=false --platform=android --bundle-output=C:\Users\chc70.ern\containergen\out\android\lib\src\main\assets\index.android.bundle --assets-dest=C:\Users\chc70.ern\containergen\out\android\lib\src\main\res\bundle (node:8360) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency (Use node --trace-warnings ... to show where the warning was created) Failed to construct transformer: Error: Cannot parse C:\Users\chc70\AppData\Local\Temp\tmp-13948GACVw0gd2pvc\D:\MovieListMiniApp\package.json as JSON: ENOENT: no such file or directory, open 'C:\Users\chc70\AppData\Local\Temp\tmp-13948GACVw0gd2pvc\D:\MovieListMiniApp\package.json' at Object. (C:\Users\chc70\AppData\Local\Temp\tmp-13948GACVw0gd2pvc\node_modules\jest-haste-map\build\worker.js:167:15) at Generator.next () at asyncGeneratorStep (C:\Users\chc70\AppData\Local\Temp\tmp-13948GACVw0gd2pvc\node_modules\jest-haste-map\build\worker.js:78:24) at _next (C:\Users\chc70\AppData\Local\Temp\tmp-13948GACVw0gd2pvc\node_modules\jest-haste-map\build\worker.js:98:9) at C:\Users\chc70\AppData\Local\Temp\tmp-13948GACVw0gd2pvc\node_modules\jest-haste-map\build\worker.js:103:7 at new Promise () at Object. (C:\Users\chc70\AppData\Local\Temp\tmp-13948GACVw0gd2pvc\node_modules\jest-haste-map\build\worker.js:95:12) at Object.worker (C:\Users\chc70\AppData\Local\Temp\tmp-13948GACVw0gd2pvc\node_modules\jest-haste-map\build\worker.js:120:18) at execFunction (C:\Users\chc70\AppData\Local\Temp\tmp-13948GACVw0gd2pvc\node_modules\jest-worker\build\workers\processChild.js:155:17) at execHelper (C:\Users\chc70\AppData\Local\Temp\tmp-13948GACVw0gd2pvc\node_modules\jest-worker\build\workers\processChild.js:139:5) { type: 'Error' } error Cannot parse C:\Users\chc70\AppData\Local\Temp\tmp-13948GACVw0gd2pvc\D:\MovieListMiniApp\package.json as JSON: ENOENT: no such file or directory, open 'C:\Users\chc70\AppData\Local\Temp\tmp-13948GACVw0gd2pvc\D:\MovieListMiniApp\package.json'. Run CLI with --verbose flag for more details.

chc7042 commented 3 years ago

Hi @friederbluemle i once again tried to ern run-android via cmd.exe and nodejs version 14.16 then i had met a problem × Generating Container locally 22s × Generating Container 22s √ Resolving native dependencies 0s √ Preparing Native Dependencies Injection 0s √ Adding Native Dependencies Hooks 0s √ Setting Android tools and libraries versions 0s √ Injecting Native Dependencies 0s √ Injecting JavaScript engine [JavaScriptCore] 1s × Bundling MiniApps 19s × Running Metro Bundler 19s × An error occurred: Command failed: C:\Users\nicolas.choi.ern\versions\0.46.0\ node_modules\ern-core\node_modules.bin\react-native bundle --entry-file=index.a ndroid.js --dev=false --platform=android --bundle-output=C:\Users\nicolas.choi. ern\containergen\out\android\lib\src\main\assets\index.android.bundle --assets-d est=C:\Users\nicolas.choi.ern\containergen\out\android\lib\src\main\res\bundle

(node:8800) Warning: Accessing non-existent property 'padLevels' of module expor ts inside circular dependency (Use node --trace-warnings ... to show where the warning was created) error Invalid regular expression: /(.\fixtures\.|node_modules[\]react[\]dist[\].|website\node_modu les\.|heapCapture\bundle.js|.\tests\.)$/: Unterminated character cla ss. Run CLI with --verbose flag for more details.

so i found article about this issue from google and change nodejs version to 12.9 then issues occured as same as previous. please help me again...

chc7042 commented 3 years ago

Hi @friederbluemle basically i wnat to know that i am planing to architect make main application with micro app (such as minApp) micro app means that it can be installed to main application (just like module of component) and remove that later time. so this could be architected from electrode natie i think. so i really want to execute this sample application. i thnk you are very busy.. but please help me

chc7042 commented 3 years ago

Hi @friederbluemle @anthonywebb @martnu @IgorGanapolsky is there no way to solve problem? i thnk your walmart has an own solution about this. please let me find clue for solve this issue

chc7042 commented 3 years ago

Hi @friederbluemle i hope to know the your enviroment of pc expecially node, and yarn version including which OS are you using. based on your comment i will try it again... in advance thank you..

friederbluemle commented 3 years ago

Hi @chc7042 - My default environments on both Linux and macOS always include the latest stable tool versions: Node.js 15.11.0 and Yarn 1.22.10 Most React Native developers at Walmart are using macOS. I will try to run some tests on my Windows test machine when I have some time (I'm currently swamped unfortunately). The error you described appears to be related to: https://stackoverflow.com/questions/58117377/react-native-start-giving-invalid-regular-expression-invalid-error As a workaround, could you try using Node.js version 10 on your machine?

chc7042 commented 3 years ago

Hi @friederbluemle i tried to change nodejs version using nvm as below D:\ADT\Workspace\weather\weather_expo>nvm list 14.16.0 12.10.0

chc7042 commented 3 years ago

Hi @friederbluemle Based on your comment. i finally solve this problem after install ubuntu 18.04 and node 14.16, yarn latest. then here is no error message and i could run movies-reloaded-miniapp thank you for you help. i will try to look into this project

chc7042 commented 3 years ago

Hi @friederbluemle after execute reload project on android emulator. i can't understand that it is working way. because https://github.com/electrode-io/movielist-miniapp.git already has mainMiniApp and miniapp without ern run-android without any argument. so i tried to learn from git reference site but it really difficult could you share the information about how does it works? https://github.com/electrode-io/movielist-miniapp.git

is there a way(or example) to know whole architecture of electrode native? in advance thank you for your help

friederbluemle commented 3 years ago

I'm not sure I understand the question.. When you only run a single miniapp, then mainMiniApp is not required (because there is only one). You only need mainMiniApp when starting multiple miniapps.

The best place to learn about the architecture and terminology of Electrode Native are the docs: https://native.electrode.io/

Syntax/arguments for run-android: https://native.electrode.io/cli-commands/run-android#syntax

chc7042 commented 3 years ago

Hi @friederbluemle thank you for your reply. what i want to know is that at first

  1. i follow the direction based on https://github.com/electrode-io/movielist-miniapp
  2. execute ern run-android without addition argument (it means that standalone execution)
  3. now i hope to see the detailed page using addition argument (ern run-android --miniapps moviedetailsminiapp --mainMiniAppName MovieListMiniApp) but it does not work finally i can't see detailed page even though touch list item) so i want to know wehere is the detailed miniapp located? i am following this page https://github.com/electrode-io/movielist-miniapp

i think if i want to invoke detailesminiapp with mainlistapp then git url should be changed to https://github.com/electrode-io/MovieDetailsMiniApp.git but readme indicate https://github.com/electrode-io/MovieListMiniApp.git

how does it invoke MovieListMiniApp is it possible to just add argument such as --miniapps moviedetailsminiapp ?

buffer8848 commented 2 years ago

I met the same issue, @chc7042 have you fixed it? my enviroment is : OS: windows 10 RN: 0.65.4