callstack / callstack/react-native-builder-bob

Unable to create to install dependencies and run example

Đang mở
#901 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
3.2k
Fork
228
Merge trung bình
7 ngày 12 giờ
Pull request đã merge (30 ngày)
3

Mô tả

➜ 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? … surya98613@gmail.com
✔ 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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Tái hiện scaffold bằng npx create-react-native-library@latest, chạy yarn trong project được tạo và sau đó chạy yarn example android. Bắt đầu với example/metro.config.js và dependency react-native-monorepo-config, sử dụng các phiên bản Yarn 1.22.22 và Node đã được báo cáo; được xem là hoàn tất khi các dependency được cài đặt mà không cần workaround và example Android khởi chạy mà không gặp lỗi Metro ESM.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript, node.js, react-native
Lĩnh vực
mobile-dev, tooling
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
42/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.