zoontek / react-native-bootsplash

🚀 Show a splash screen during app startup. Hide it when you are ready.
MIT License
3.73k stars 257 forks source link

(0 , _cliTools.findProjectRoot) is not a function #641

Closed gaweki closed 1 month ago

gaweki commented 1 month ago

Before submitting a new issue

Bug summary

i ran command like below

developer@ITs-MacBook-Air-2 project-app % npx react-native generate-bootsplash src/assets/icons/account.svg
warn Package @types/jest has been ignored because it contains invalid configuration. Reason: Package subpath './package.json' is not defined by "exports" in /Users/developer/pathFolder/project-app/node_modules/@types/jest/package.json
error (0 , _cliTools.findProjectRoot) is not a function.
TypeError: (0 , _cliTools.findProjectRoot) is not a function
    at Object.<anonymous> (/Users/developer/pathFolder/project-app/node_modules/react-native-bootsplash/dist/commonjs/generate.js:29:51)
    at Module._compile (node:internal/modules/cjs/loader:1198:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
    at Module.load (node:internal/modules/cjs/loader:1076:32)
    at Function.Module._load (node:internal/modules/cjs/loader:911:12)
    at Module.require (node:internal/modules/cjs/loader:1100:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.func (/Users/developer/pathFolder/project-app/node_modules/react-native-bootsplash/react-native.config.js:90:26)
    at Command.handleAction (/Users/developer/pathFolder/project-app/node_modules/@react-native-community/cli/build/index.js:192:23)
    at Command.listener (/Users/developer/pathFolder/project-app/node_modules/commander/index.js:315:8)
info Run CLI with --verbose flag for more details.

Library version

6.2.2

Environment info

System:
    OS: macOS 12.7
    CPU: (8) arm64 Apple M1
    Memory: 95.34 MB / 8.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.20.2 
    Yarn: 1.22.19 
    npm: 8.19.4 - 
    Watchman: 2023.05.01.00 - 
  Managers:
    CocoaPods: 1.12.1 
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
    Android SDK: Not Found
  Languages:
    Java: 11.0.17 
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2 
    react-native: 0.66.3 => 0.66.3 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found
developer@ITs-MacBook-Air-2 project-app % npx react-native --version
warn Package @types/jest has been ignored because it contains invalid configuration. Reason: Package subpath './package.json' is not defined by "exports" in /Users/developer/pathproject-app/node_modules/@types/jest/package.json
6.2.0
developer@ITs-MacBook-Air-2 ~ % npx react-native --version
react-native-cli: 2.0.1
react-native: n/a - not inside a React Native project directory

Steps to reproduce

  1. run npx react-native generate-bootsplash src/assets/icons/account.svg

Reproducible sample code

npx react-native generate-bootsplash src/assets/icons/account.svg
zoontek commented 1 month ago
react-native: 0.66.3 => 0.66.3

According to the README:

Screenshot 2024-10-16 at 11 40 20

Please update React Native, or use an old react-native-bootsplash version.