react-native-bootsplash: Cannot generate assets, error Unrecognized command "generate-bootsplash".

Bug report

Summary

Get an error trying to generate assets: Run this in terminal:

npx react-native generate-bootsplash ./src/assets/images/app/logo.png --background-color=000 --logo-width=200 --assets-path=./src/assets/images/bootsplash
warn Package react-native-bootsplash has been ignored because it contains invalid configuration. Reason: Unexpected token {
error Unrecognized command "generate-bootsplash".
info Run "react-native --help" to see a list of all available commands.

Environment info

react-native info output:

System:
    OS: macOS 10.15.6
    CPU: (4) x64 Intel(R) Core(TM) i3-8100B CPU @ 3.60GHz
    Memory: 1.18 GB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 8.17.0 - ~/.nvm/versions/node/v8.17.0/bin/node
    Yarn: Not Found
    npm: 6.14.8 - ~/.nvm/versions/node/v8.17.0/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.10.0 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.2, DriverKit 20.0, macOS 11.0, tvOS 14.2, watchOS 7.1
    Android SDK: Not Found
  IDEs:
    Android Studio: 4.1 AI-201.8743.12.41.6953283
    Xcode: 12.2/12B45b - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.8 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1 
    react-native: 0.63.4 => 0.63.4 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Library version: 3.1.2

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 21 (9 by maintainers)

Most upvoted comments

Please run this in terminal:

npx generate-bootsplash --help or yarn generate-bootsplash --help

@zoontek Somehow I manage to fix the issue, i removed the lock files and node_packages and reinstalling again. Now the command is reconegnized. Thank for blazingly fast response to my issue.

My bad. Issue solved after upgrading my react native to 0.63. Sorry & thanks!

Screenshot 2020-12-24 at 00 07 08

Confirmed, just update node.

Hi. Try upgrading to at least node 10. One of the dependencies, chalk, require it: https://github.com/chalk/chalk/releases/tag/v4.0.0

Latest LTS is v14: https://nodejs.org/en/

If you have to use multiple node versions, I recommend fnm: https://github.com/Schniz/fnm