Cli: error RangeError: Maximum call stack size exceeded

Created on 29 Sep 2019  Â·  7Comments  Â·  Source: react-native-community/cli

npx react-native init MyApp

               ######                ######
             ###     ####        ####     ###
            ##          ###    ###          ##
            ##             ####             ##
            ##             ####             ##
            ##           ##    ##           ##
            ##         ###      ###         ##
             ##  ########################  ##
          ######    ###            ###    ######
      ###     ##    ##              ##    ##     ###
   ###         ## ###      ####      ### ##         ###
  ##           ####      ########      ####           ##
 ##             ###     ##########     ###             ##
  ##           ####      ########      ####           ##
   ###         ## ###      ####      ### ##         ###
      ###     ##    ##              ##    ##     ###
          ######    ###            ###    ######
             ##  ########################  ##
            ##         ###      ###         ##
            ##           ##    ##           ##
            ##             ####             ##
            ##             ####             ##
            ##          ###    ###          ##
             ###     ####        ####     ###
               ######                ######


                  Welcome to React Native!
                 Learn Once Write Anywhere

✔ Downloading template
✖ Copying template
error RangeError: Maximum call stack size exceeded

envrionment info:

kenny@Kennys-Mac-mini ~ $ node -v
v10.16.3
kenny@Kennys-Mac-mini ~ $ npm -v
6.9.0
kenny@Kennys-Mac-mini ~ $ yarn -v
1.17.3
bug report

Most helpful comment

For me, uninstalled global binary react-native then I can run npx react-native init MyApp successfully.
You can do npm list -g --depth=0 and yarn global list to check if react-native binary exists

All 7 comments

hi @Kennytian could you check your node version? Had the same issue, and seems that this error is happening on node v12.x.x. When you rollback to v10.x.x the error seems to be gone and react-native init works properly on legacy and cli versions!

@oytuneyucel I have the error on both node v10.16.3 and node v12.11.0, using the react-native cli v2.9.0. (on Ubuntu 19.04). cli was installed using yarn global.

@oytuneyucel

kenny@Kennys-Mac-mini ~ $ node -v
v10.16.3
kenny@Kennys-Mac-mini ~ $ npm -v
6.9.0
kenny@Kennys-Mac-mini ~ $ yarn -v
1.17.3

the same to me

✔ Downloading template
✖ Copying template
error RangeError: Maximum call stack size exceeded

I ran into the same issue. Running on macOS 10.14.1, node 10.15.1, yarn 1.13.0.

It only happened when I first ran yarn global add @react-native-community/cli and then react-native init asdf, with the same exact output:

✔ Downloading template
✖ Copying template
error RangeError: Maximum call stack size exceeded

However everything seems to work fine with npx react-native init asdf.

@zxti @react-native-community/cli is not intended to be used as global as it registers global react-native binary. Please remove it and use the one installed locally by react-native package.

Please upgrade the Node version to latest LTS and try installing again.

For me, uninstalled global binary react-native then I can run npx react-native init MyApp successfully.
You can do npm list -g --depth=0 and yarn global list to check if react-native binary exists

Was this page helpful?
0 / 5 - 0 ratings