Unable to create to install dependencies and run example
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 42/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- javascript, node.js, react-native
- 領域
- mobile-dev, tooling
研究方向
使用 npx create-react-native-library@latest 重現 scaffold,在產生的專案中執行 yarn,然後執行 yarn example android。使用回報的 Yarn 1.22.22 與 Node 版本,從 example/metro.config.js 和相依性 react-native-monorepo-config 開始;當相依性不需 workaround 即可安裝,且 Android example 在沒有 Metro ESM 錯誤的情況下啟動時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
➜ main nvm ls
v20.12.2
-> v20.19.5
main npx create-react-native-library@latest awesome-library
✔ What is the name of the npm package? … react-native-awesome-library
✔ What is the description for the package? … Testing
✔ What is the name of package author? … 0xSuryax
✔ What is the email address for the package author? … [email protected]
✔ What is the URL for the package author? … https://github.com/0xSuryax
✔ What is the URL for the repository? … https://github.com/0xSuryax/react-native-awesome-library
✔ What type of library do you want to develop? › Turbo module
✔ Project created successfully at awesome-library!
Get started with the project:
$ yarn
Run the example app on iOS:
$ yarn example ios
Run the example app on Android:
$ yarn example android
See CONTRIBUTING.md for more details. Good luck!
➜ awesome-library git:(main) yarn
Usage Error: The nearest package directory (/Users/qwerty/RESEARCH/MY_OWN_LIBS/main/awesome-library) doesn't seem to be part of the project declared in /Users/qwerty.
- If /Users/qwerty isn't intended to be a project, remove any yarn.lock and/or package.json file there.
- If /Users/qwerty is intended to be a project, it might be that you forgot to list RESEARCH/MY_OWN_LIBS/main/awesome-library in its workspace configuration.
- Finally, if /Users/qwerty is fine and you intend RESEARCH/MY_OWN_LIBS/main/awesome-library to be treated as a completely separate project (not even a workspace), create an empty yarn.lock file in it.
$ yarn install [--json] [--immutable] [--immutable-cache] [--check-cache] [--inline-builds] [--mode #0]
then i created an empty yarn.lock file then i m able to install dependencies
then i run yarn example android and i got
➜ ~ /Users/qwerty/RESEARCH/MY_OWN_LIBS/main/awesome-library/example/node_modules/.generated/launchPackager.command ; exit;
error Error loading Metro config at: /Users/qwerty/RESEARCH/MY_OWN_LIBS/main/awesome-library/example/metro.config.js
require() of ES Module /Users/qwerty/RESEARCH/MY_OWN_LIBS/main/awesome-library/example/node_modules/react-native-monorepo-config/index.js from /Users/qwerty/RESEARCH/MY_OWN_LIBS/main/awesome-library/example/metro.config.js not supported.
Instead change the require of index.js in /Users/qwerty/RESEARCH/MY_OWN_LIBS/main/awesome-library/example/metro.config.js to a dynamic import() which is available in all CommonJS modules.
Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/qwerty/RESEARCH/MY_OWN_LIBS/main/awesome-library/example/node_modules/react-native-monorepo-config/index.js from /Users/qwerty/RESEARCH/MY_OWN_LIBS/main/awesome-library/example/metro.config.js not supported.
Instead change the require of index.js in /Users/qwerty/RESEARCH/MY_OWN_LIBS/main/awesome-library/example/metro.config.js to a dynamic import() which is available in all CommonJS modules.
at Object. (/Users/qwerty/RESEARCH/MY_OWN_LIBS/main/awesome-library/example/metro.config.js:3:29)
Process terminated. Press to close the window
➜ ~ yarn --version
1.22.22
- 主要語言
- JavaScript
- 星號
- 3.2k
- 分支
- 229
- 平均合併
- 2 天 15 小時
- 30 天內合併 PR
- 5
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
callstack/react-native-builder-bob 的其他 Issue
-
bug
難度 3/5 1-2 天 新手友好度 42/100
callstack/react-native-builder-bob#896 · 2 則留言 ·
-
bug
難度 4/5 3-5 天 新手友好度 25/100
-
bug
難度 3/5 1-2 天 新手友好度 42/100
callstack/react-native-builder-bob#852 · 1 則留言 · 1 個 reaction ·
-
bug
難度 4/5 3-5 天 新手友好度 35/100
callstack/react-native-builder-bob#829 · 20 則留言 ·
-
bug
難度 4/5 3-5 天 新手友好度 35/100
callstack/react-native-builder-bob#817 · 5 則留言 ·
查看 callstack/react-native-builder-bob 的全部 Issue
相似的 Issue
-
難度 1/5 1 小時以內 新手友好度 85/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
vercel-labs/agent-skills#348 ·
-
難度 2/5 1-3 小時 新手友好度 65/100
NanmiCoder/dsh-agent-teams#289 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 70/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 83/100
c1overzz/dsh-bili-scroll#124 ·
維護者通常 1 天內回覆