Error installing React Native

0

Hi, I'll treat you my problem,

I'm trying to install React Native in Ubuntu / Linux GNU, in the documentation it says that it is assumed that you have installed Node JS in your system as they comment here:

Assuming that you have installed, you can use npm to install the create-reactive-native-app command line utility:

and if I have installed Node JS as you see on my terminal:

As you can see I have the version:

 v0.8.21 

I execute the command:

 npm install -g create-react-native-app 

to install the create-react-native-app as it says in your documentation.

When I try to create an example application, I miss this error:


root@sommer0123-AO532h:~# npm install -g create-react-native-app
▄ ╢░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
WARN engine [email protected]: wanted: {"node":">=6"} (current: {"noloadRequestedDeps         ▐ ╢██████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
WARN engine [email protected]: wanted: {"node":">=6"} (current: {"no/usr/local/bin/create-react-native-app -> /usr/local/lib/node_modules/create-react-native-app/build/index.js
/usr/local/lib
└─┬ [email protected] 
  ├─┬ [email protected] 
  │ ├── [email protected] 
  │ └── [email protected] 
  ├─┬ [email protected] 
  │ ├─┬ [email protected] 
  │ │ └─┬ [email protected] 
  │ │   └── [email protected] 
  │ ├── [email protected] 
  │ └─┬ [email protected] 
  │   └── [email protected] 
  ├─┬ [email protected] 
  │ ├─┬ [email protected] 
  │ │ ├── [email protected] 
  │ │ └── [email protected] 
  │ ├─┬ [email protected] 
  │ │ └── [email protected] 
  │ └─┬ [email protected] 
  │   └── [email protected] 
  ├─┬ [email protected] 
  │ ├── [email protected] 
  │ ├── [email protected] 
  │ └── [email protected] 
  ├── [email protected] 
  ├── [email protected] 
  ├── [email protected] 
  └─┬ [email protected] 
    └── [email protected] 

root@sommer0123-AO532h:~# create-react-native-app AwesomeProject

/usr/local/lib/node_modules/create-react-native-app/node_modules/fs-extra/lib/index.js:3
const assign = require('./util/assign')
^^^^^
SyntaxError: Use of const in strict mode.
    at Module._compile (module.js:437:25)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object. (/usr/local/lib/node_modules/create-react-native-app/build/index.js:233:16)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)

The command I use to create the application is this:

 create-react-native-app AwesomeProject

Does anyone have any idea what I did wrong?

    
asked by Gilberto 22.12.2017 в 01:02
source

1 answer

2

The version of the Node must be greater than or equal to 6 in order to use create-react-native-app .

  

You will need to have Node v6 or later on your machine. We recommend using npm v3, v4 or a recent version of Yarn. The Create React Native application does not currently work with npm v5 due to errors in npm

Source: react-community

That tells you on the line:

 WARN engine [email protected]: wanted: {"node":">=6"} (current: 
 {"noloadRequestedDeps         ▐ 
 ╢██████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
 WARN engine [email protected]: wanted: {"node":">=6"} (current: 
 {"no/usr/local/bin/create-react-native-app -> 
 /usr/local/lib/node_modules/create-react-native-app/build/index.js
  

"node": "> = 6"

and your version is

  

v0.8.21

Change or reinstall Node and try again greetings.

    
answered by 22.12.2017 в 01:20